playwright.yaml
This commit is contained in:
37
.github/workflows/playwright.yaml
vendored
37
.github/workflows/playwright.yaml
vendored
@ -24,31 +24,36 @@ jobs:
|
|||||||
id: surge_deploy
|
id: surge_deploy
|
||||||
if: ${{ github.actor != 'nektos/act' }} # https://nektosact.com/usage/index.html#skipping-steps
|
if: ${{ github.actor != 'nektos/act' }} # https://nektosact.com/usage/index.html#skipping-steps
|
||||||
uses: yanhao98/composite-actions/deploy-dist-to-surge@7797ee90d26ae6e347ccf0301c49f0c116c45a3b
|
uses: yanhao98/composite-actions/deploy-dist-to-surge@7797ee90d26ae6e347ccf0301c49f0c116c45a3b
|
||||||
|
# playwright:
|
||||||
|
# needs: surge
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# 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: npx playwright test
|
||||||
|
# env:
|
||||||
|
# BASE_URL: ${{ needs.surge.outputs.url }}
|
||||||
|
# - name: 🧹 清理 Surge 部署
|
||||||
|
# run: npx surge teardown ${{ needs.surge.outputs.url }} --token ${{ env.SURGE_TOKEN}}
|
||||||
|
# env:
|
||||||
|
# SURGE_TOKEN: d843de16b331c626f10771245c56ed93
|
||||||
playwright:
|
playwright:
|
||||||
needs: surge
|
needs: surge
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# container: yanhao98/runner-images:pnpm-with-playwright
|
container: mcr.microsoft.com/playwright:v1.51.1-noble
|
||||||
steps:
|
steps:
|
||||||
- name: ⚙️ 设置 Node 环境
|
- name: ⚙️ 设置 Node 环境
|
||||||
uses: yanhao98/composite-actions/setup-node-environment@7797ee90d26ae6e347ccf0301c49f0c116c45a3b
|
uses: yanhao98/composite-actions/setup-node-environment@7797ee90d26ae6e347ccf0301c49f0c116c45a3b
|
||||||
|
|
||||||
# - name: 📥 安装 Playwright 浏览器
|
# - name: 📥 安装 Playwright 浏览器
|
||||||
# run: pnpm exec playwright install --with-deps
|
# 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 测试
|
- name: ▶️ 运行 Playwright 测试
|
||||||
run: |
|
run: npx playwright test
|
||||||
docker run --rm --ipc=host \
|
env:
|
||||||
-e CI=true \
|
BASE_URL: ${{ needs.surge.outputs.url }}
|
||||||
-e BASE_URL=${{ needs.surge.outputs.url }} \
|
|
||||||
-v ${{ github.workspace }}:/workdir \
|
|
||||||
--workdir /workdir \
|
|
||||||
mcr.microsoft.com/playwright:v1.51.1-noble npx --no-install playwright test
|
|
||||||
|
|
||||||
- name: 🧹 清理 Surge 部署
|
- name: 🧹 清理 Surge 部署
|
||||||
run: npx surge teardown ${{ needs.surge.outputs.url }} --token ${{ env.SURGE_TOKEN}}
|
run: npx surge teardown ${{ needs.surge.outputs.url }} --token ${{ env.SURGE_TOKEN}}
|
||||||
env:
|
env:
|
||||||
|
Reference in New Issue
Block a user