1616 default : ' false'
1717
1818jobs :
19+ changes :
20+ runs-on : ubuntu-latest
21+ # Set job outputs to values from filter step
22+ outputs :
23+ changed : ${{ steps.filter.outputs.changed }}
24+ steps :
25+ - uses : actions/checkout@v4
26+ # For pull requests it's not necessary to checkout the code but for the main branch it is
27+ - uses : dorny/paths-filter@v3
28+ id : filter
29+ with :
30+ filters : |
31+ changed:
32+ - backend/**
33+ - frontend/**
34+ - .env
35+ - docker-compose*.yml
36+ - .github/workflows/playwright.yml
1937
20- test :
38+ test-playwright :
39+ needs :
40+ - changes
41+ if : ${{ needs.changes.outputs.changed == 'true' }}
2142 timeout-minutes : 60
2243 runs-on : ubuntu-latest
44+ strategy :
45+ matrix :
46+ shardIndex : [1, 2, 3, 4]
47+ shardTotal : [4]
48+ fail-fast : false
2349 steps :
2450 - uses : actions/checkout@v4
2551 - uses : actions/setup-node@v4
@@ -33,35 +59,61 @@ jobs:
3359 if : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
3460 with :
3561 limit-access-to-actor : true
36- - name : Install dependencies
37- run : npm ci
38- working-directory : frontend
39- - name : Install Playwright Browsers
40- run : npx playwright install --with-deps
41- working-directory : frontend
4262 - run : docker compose build
4363 - run : docker compose down -v --remove-orphans
44- - run : docker compose up -d --wait backend mailcatcher
4564 - name : Run Playwright tests
46- run : npx playwright test --fail-on-flaky-tests --trace=retain-on-failure
47- working-directory : frontend
65+ run : docker compose run --rm playwright npx playwright test --fail-on-flaky-tests --trace=retain-on-failure --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
4866 - run : docker compose down -v --remove-orphans
49- - uses : actions/upload-artifact@v4
50- if : always()
67+ - name : Upload blob report to GitHub Actions Artifacts
68+ if : ${{ !cancelled() }}
69+ uses : actions/upload-artifact@v4
70+ with :
71+ name : blob-report-${{ matrix.shardIndex }}
72+ path : frontend/blob-report
73+ include-hidden-files : true
74+ retention-days : 1
75+
76+ merge-playwright-reports :
77+ needs :
78+ - test-playwright
79+ - changes
80+ # Merge reports after playwright-tests, even if some shards have failed
81+ if : ${{ !cancelled() && needs.changes.outputs.changed == 'true' }}
82+ runs-on : ubuntu-latest
83+ steps :
84+ - uses : actions/checkout@v4
85+ - uses : actions/setup-node@v4
86+ with :
87+ node-version : 20
88+ - name : Install dependencies
89+ run : npm ci
90+ working-directory : frontend
91+ - name : Download blob reports from GitHub Actions Artifacts
92+ uses : actions/download-artifact@v4
93+ with :
94+ path : frontend/all-blob-reports
95+ pattern : blob-report-*
96+ merge-multiple : true
97+ - name : Merge into HTML Report
98+ run : npx playwright merge-reports --reporter html ./all-blob-reports
99+ working-directory : frontend
100+ - name : Upload HTML report
101+ uses : actions/upload-artifact@v4
51102 with :
52- name : playwright -report
53- path : frontend/playwright-report/
103+ name : html -report--attempt-${{ github.run_attempt }}
104+ path : frontend/playwright-report
54105 retention-days : 30
55106 include-hidden-files : true
56107
57108 # https://github.com/marketplace/actions/alls-green#why
58- e2e- alls-green : # This job does nothing and is only used for the branch protection
109+ alls-green-playwright : # This job does nothing and is only used for the branch protection
59110 if : always()
60111 needs :
61- - test
112+ - test-playwright
62113 runs-on : ubuntu-latest
63114 steps :
64115 - name : Decide whether the needed jobs succeeded or failed
65116 uses : re-actors/alls-green@release/v1
66117 with :
67118 jobs : ${{ toJSON(needs) }}
119+ allowed-skips : test-playwright
0 commit comments