Skip to content

Commit 1be00ba

Browse files
refactor: improve Playwright workflow structure and artifact handling
1 parent 8872dd2 commit 1be00ba

1 file changed

Lines changed: 26 additions & 8 deletions

File tree

.github/workflows/playwright.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,62 @@ on:
44
branches: [main, feat-multi-tabs]
55
pull_request:
66
branches: [main, feat-multi-tabs]
7+
78
jobs:
89
test:
910
timeout-minutes: 60
1011
runs-on: ubuntu-latest
1112
steps:
1213
- uses: actions/checkout@v4
14+
1315
- uses: actions/setup-node@v4
1416
with:
1517
node-version: lts/*
18+
1619
- name: Install dependencies
1720
run: npm install -g yarn && yarn
21+
1822
- name: Install Playwright Browsers
1923
run: yarn playwright install --with-deps chromium
24+
2025
- name: Build Electron main process
2126
run: yarn electron:serve-tsc
2227

2328
- name: Start Angular dev server and wait
2429
run: |
2530
yarn ng:serve:dev &
2631
SERVER_PID=$!
27-
2832
# Wait for server to be ready, checking process health
2933
yarn wait-on http://localhost:4200 --timeout 120000 || {
3034
echo "wait-on failed. Checking if server process is alive..."
3135
kill -0 $SERVER_PID 2>/dev/null && echo "Process alive but not responding" || echo "Process is dead"
3236
exit 1
3337
}
34-
3538
echo "SERVER_PID=$SERVER_PID" >> $GITHUB_ENV
3639
3740
- name: Run Playwright tests
41+
id: playwright-tests
42+
continue-on-error: true
3843
run: xvfb-run --auto-servernum yarn e2e
3944

40-
- uses: actions/upload-artifact@v4
41-
if: failure() && steps.playwright-tests.outcome == 'failure'
45+
- name: Upload Playwright Report
46+
if: always()
47+
uses: actions/upload-artifact@v4
4248
with:
43-
name: playwright-failures
44-
path: |
45-
playwright-report/
46-
screenshots/
49+
name: playwright-report
50+
path: e2e/playwright-report/
4751
retention-days: 30
52+
if-no-files-found: warn
53+
54+
- name: Upload Test Results (screenshots, traces)
55+
if: always()
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: test-results
59+
path: e2e/playwright-report/test-results/
60+
retention-days: 30
61+
if-no-files-found: ignore
62+
63+
- name: Fail job if tests failed
64+
if: steps.playwright-tests.outcome == 'failure'
65+
run: exit 1

0 commit comments

Comments
 (0)