Playwright Tests
This commit is contained in:
28
.github/workflows/ci.yaml
vendored
28
.github/workflows/ci.yaml
vendored
@ -12,14 +12,16 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
cache-and-install:
|
build-and-deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- run: sed -i '/use-node-version/d' .npmrc
|
- run: |
|
||||||
|
sed -i '/use-node-version/d' .npmrc;
|
||||||
|
sed -i '/node-mirror/d' .npmrc;
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v4
|
- uses: pnpm/action-setup@v4
|
||||||
name: Install pnpm
|
name: Install pnpm
|
||||||
@ -64,3 +66,25 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cp dist/index.html dist/200.html
|
cp dist/index.html dist/200.html
|
||||||
pnpx surge dist https://vue-ts-example.surge.sh --token ${{ secrets.SURGE_TOKEN }}
|
pnpx surge dist https://vue-ts-example.surge.sh --token ${{ secrets.SURGE_TOKEN }}
|
||||||
|
|
||||||
|
test:
|
||||||
|
needs: build-and-deploy
|
||||||
|
timeout-minutes: 60
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: lts/*
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm install -g pnpm && pnpm install
|
||||||
|
- name: Install Playwright Browsers
|
||||||
|
run: pnpm exec playwright install --with-deps
|
||||||
|
- name: Run Playwright tests
|
||||||
|
run: pnpm exec playwright test
|
||||||
|
# - uses: actions/upload-artifact@v4
|
||||||
|
# if: ${{ !cancelled() }}
|
||||||
|
# with:
|
||||||
|
# name: playwright-report
|
||||||
|
# path: playwright-report/
|
||||||
|
# retention-days: 30
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
name: Playwright Tests
|
name: Playwright Tests
|
||||||
on:
|
on:
|
||||||
workflow_run:
|
push:
|
||||||
workflows: ['CI'] # 这里的名称应该是你的 `ci.yaml` 中定义的工作流名称
|
branches: [main, master]
|
||||||
types:
|
pull_request:
|
||||||
- completed
|
branches: [main, master]
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
Reference in New Issue
Block a user