|
4 | 4 | branches: [main, feat-multi-tabs] |
5 | 5 | pull_request: |
6 | 6 | branches: [main, feat-multi-tabs] |
| 7 | + |
7 | 8 | jobs: |
8 | 9 | test: |
9 | 10 | timeout-minutes: 60 |
10 | 11 | runs-on: ubuntu-latest |
11 | 12 | steps: |
12 | 13 | - uses: actions/checkout@v4 |
| 14 | + |
13 | 15 | - uses: actions/setup-node@v4 |
14 | 16 | with: |
15 | 17 | node-version: lts/* |
| 18 | + |
16 | 19 | - name: Install dependencies |
17 | 20 | run: npm install -g yarn && yarn |
| 21 | + |
18 | 22 | - name: Install Playwright Browsers |
19 | 23 | run: yarn playwright install --with-deps chromium |
| 24 | + |
20 | 25 | - name: Build Electron main process |
21 | 26 | run: yarn electron:serve-tsc |
22 | 27 |
|
23 | 28 | - name: Start Angular dev server and wait |
24 | 29 | run: | |
25 | 30 | yarn ng:serve:dev & |
26 | 31 | SERVER_PID=$! |
27 | | -
|
28 | 32 | # Wait for server to be ready, checking process health |
29 | 33 | yarn wait-on http://localhost:4200 --timeout 120000 || { |
30 | 34 | echo "wait-on failed. Checking if server process is alive..." |
31 | 35 | kill -0 $SERVER_PID 2>/dev/null && echo "Process alive but not responding" || echo "Process is dead" |
32 | 36 | exit 1 |
33 | 37 | } |
34 | | -
|
35 | 38 | echo "SERVER_PID=$SERVER_PID" >> $GITHUB_ENV |
36 | 39 |
|
37 | 40 | - name: Run Playwright tests |
| 41 | + id: playwright-tests |
| 42 | + continue-on-error: true |
38 | 43 | run: xvfb-run --auto-servernum yarn e2e |
39 | 44 |
|
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 |
42 | 48 | with: |
43 | | - name: playwright-failures |
44 | | - path: | |
45 | | - playwright-report/ |
46 | | - screenshots/ |
| 49 | + name: playwright-report |
| 50 | + path: e2e/playwright-report/ |
47 | 51 | 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