mirror of
https://github.com/zen-browser/www.git
synced 2025-07-07 17:05:32 +02:00
refactor: use playwright docker image for e2e tests
This commit is contained in:
parent
c540cc914e
commit
4e2eccbbc9
3 changed files with 16 additions and 21 deletions
20
.github/workflows/ci-pipeline.yml
vendored
20
.github/workflows/ci-pipeline.yml
vendored
|
@ -183,6 +183,9 @@ jobs:
|
|||
needs: [check_changes, setup, build]
|
||||
if: ${{ needs.check_changes.outputs.exists == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: mcr.microsoft.com/playwright:v1.53.0-jammy
|
||||
options: --ipc=host
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
|
@ -211,11 +214,6 @@ jobs:
|
|||
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: ${{ runner.os }}-node-modules-
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: lts/*
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
|
@ -225,18 +223,8 @@ jobs:
|
|||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Cache Playwright Browsers
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: ${{ runner.os }}-playwright-
|
||||
|
||||
- name: Install Playwright Browsers
|
||||
run: pnpm exec playwright install --with-deps
|
||||
|
||||
- name: Run Playwright Tests (4 Shards)
|
||||
run: pnpm exec turbo run test:e2e:shard1 test:e2e:shard2 test:e2e:shard3 test:e2e:shard4
|
||||
run: pnpm exec turbo run test:e2e:all
|
||||
timeout-minutes: 10
|
||||
|
||||
- name: Upload Playwright Report
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
"test:e2e:shard2": "playwright test --shard=2/4",
|
||||
"test:e2e:shard3": "playwright test --shard=3/4",
|
||||
"test:e2e:shard4": "playwright test --shard=4/4",
|
||||
"test:e2e:all": "turbo run test:e2e:all",
|
||||
"prepare": "lefthook install"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
16
turbo.json
16
turbo.json
|
@ -30,30 +30,36 @@
|
|||
"inputs": ["src/**/*.{ts,tsx,js,jsx,astro,md,json,yml,yaml}"],
|
||||
"outputs": []
|
||||
},
|
||||
"test:playwright": {
|
||||
"test:e2e": {
|
||||
"cache": true,
|
||||
"inputs": ["**/*.{ts,tsx,js,jsx,astro}"],
|
||||
"outputs": ["playwright-report/**", "test-results/**"]
|
||||
},
|
||||
"test:playwright:shard1": {
|
||||
"test:e2e:shard1": {
|
||||
"cache": true,
|
||||
"inputs": ["**/*.{ts,tsx,js,jsx,astro}"],
|
||||
"outputs": ["playwright-report/**", "test-results/**"]
|
||||
},
|
||||
"test:playwright:shard2": {
|
||||
"test:e2e:shard2": {
|
||||
"cache": true,
|
||||
"inputs": ["**/*.{ts,tsx,js,jsx,astro}"],
|
||||
"outputs": ["playwright-report/**", "test-results/**"]
|
||||
},
|
||||
"test:playwright:shard3": {
|
||||
"test:e2e:shard3": {
|
||||
"cache": true,
|
||||
"inputs": ["**/*.{ts,tsx,js,jsx,astro}"],
|
||||
"outputs": ["playwright-report/**", "test-results/**"]
|
||||
},
|
||||
"test:playwright:shard4": {
|
||||
"test:e2e:shard4": {
|
||||
"cache": true,
|
||||
"inputs": ["**/*.{ts,tsx,js,jsx,astro}"],
|
||||
"outputs": ["playwright-report/**", "test-results/**"]
|
||||
},
|
||||
"test:e2e:all": {
|
||||
"cache": true,
|
||||
"dependsOn": ["test:e2e:shard1", "test:e2e:shard2", "test:e2e:shard3", "test:e2e:shard4"],
|
||||
"inputs": ["**/*.{ts,tsx,js,jsx,astro}"],
|
||||
"outputs": ["playwright-report/**", "test-results/**"]
|
||||
}
|
||||
},
|
||||
"ui": "tui"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue