From 8db3b598549d8dbae7993f7f2dd8b4010a0a17e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E6=B5=A9?= Date: Fri, 11 Apr 2025 09:34:20 +0800 Subject: [PATCH] playwright.yaml --- .github/workflows/playwright.yaml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/playwright.yaml b/.github/workflows/playwright.yaml index 5468954..e3a44e6 100644 --- a/.github/workflows/playwright.yaml +++ b/.github/workflows/playwright.yaml @@ -27,16 +27,28 @@ jobs: playwright: needs: surge runs-on: ubuntu-latest - container: yanhao98/runner-images:pnpm-with-playwright + # container: yanhao98/runner-images:pnpm-with-playwright steps: - name: ⚙️ 设置 Node 环境 uses: yanhao98/composite-actions/setup-node-environment@7797ee90d26ae6e347ccf0301c49f0c116c45a3b - - name: 📥 安装 Playwright 浏览器 - run: pnpm exec playwright install --with-deps + + # - name: 📥 安装 Playwright 浏览器 + # run: pnpm exec playwright install --with-deps + # - name: ▶️ 运行 Playwright 测试 + # run: npx playwright test + # env: + # BASE_URL: ${{ needs.surge.outputs.url }} + + # https://mcr.microsoft.com/en-us/artifact/mar/playwright/ - name: ▶️ 运行 Playwright 测试 - run: npx playwright test - env: - BASE_URL: ${{ needs.surge.outputs.url }} + run: | + docker run --rm --ipc=host \ + -e CI=true \ + -e BASE_URL=${{ needs.surge.outputs.url }} \ + -v $(pwd):/workdir \ + --workdir /workdir \ + mcr.microsoft.com/playwright:v1.51.1-noble npx --no-install playwright test + - name: 🧹 清理 Surge 部署 run: npx surge teardown ${{ needs.surge.outputs.url }} --token ${{ env.SURGE_TOKEN}} env: