16
16
default : ' false'
17
17
18
18
jobs :
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
19
37
20
- test :
38
+ test-playwright :
39
+ needs :
40
+ - changes
41
+ if : ${{ needs.changes.outputs.changed == 'true' }}
21
42
timeout-minutes : 60
22
43
runs-on : ubuntu-latest
44
+ strategy :
45
+ matrix :
46
+ shardIndex : [1, 2, 3, 4]
47
+ shardTotal : [4]
48
+ fail-fast : false
23
49
steps :
24
50
- uses : actions/checkout@v4
25
51
- uses : actions/setup-node@v4
@@ -33,35 +59,73 @@ jobs:
33
59
if : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
34
60
with :
35
61
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
62
+ - name : Install uv
63
+ uses : astral-sh/setup-uv@v5
64
+ with :
65
+ version : " 0.4.15"
66
+ enable-cache : true
67
+ - run : uv sync
68
+ working-directory : backend
69
+ - run : npm ci
41
70
working-directory : frontend
71
+ - run : uv run bash scripts/generate-client.sh
72
+ env :
73
+ VIRTUAL_ENV : backend/.venv
42
74
- run : docker compose build
43
75
- run : docker compose down -v --remove-orphans
44
- - run : docker compose up -d --wait backend mailcatcher
45
76
- name : Run Playwright tests
46
- run : npx playwright test --fail-on-flaky-tests --trace=retain-on-failure
47
- working-directory : frontend
77
+ run : docker compose run --rm playwright npx playwright test --fail-on-flaky-tests --trace=retain-on-failure --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
48
78
- run : docker compose down -v --remove-orphans
49
- - uses : actions/upload-artifact@v4
50
- if : always()
79
+ - name : Upload blob report to GitHub Actions Artifacts
80
+ if : ${{ !cancelled() }}
81
+ uses : actions/upload-artifact@v4
82
+ with :
83
+ name : blob-report-${{ matrix.shardIndex }}
84
+ path : frontend/blob-report
85
+ include-hidden-files : true
86
+ retention-days : 1
87
+
88
+ merge-playwright-reports :
89
+ needs :
90
+ - test-playwright
91
+ - changes
92
+ # Merge reports after playwright-tests, even if some shards have failed
93
+ if : ${{ !cancelled() && needs.changes.outputs.changed == 'true' }}
94
+ runs-on : ubuntu-latest
95
+ steps :
96
+ - uses : actions/checkout@v4
97
+ - uses : actions/setup-node@v4
98
+ with :
99
+ node-version : 20
100
+ - name : Install dependencies
101
+ run : npm ci
102
+ working-directory : frontend
103
+ - name : Download blob reports from GitHub Actions Artifacts
104
+ uses : actions/download-artifact@v4
105
+ with :
106
+ path : frontend/all-blob-reports
107
+ pattern : blob-report-*
108
+ merge-multiple : true
109
+ - name : Merge into HTML Report
110
+ run : npx playwright merge-reports --reporter html ./all-blob-reports
111
+ working-directory : frontend
112
+ - name : Upload HTML report
113
+ uses : actions/upload-artifact@v4
51
114
with :
52
- name : playwright -report
53
- path : frontend/playwright-report/
115
+ name : html -report--attempt-${{ github.run_attempt }}
116
+ path : frontend/playwright-report
54
117
retention-days : 30
55
118
include-hidden-files : true
56
119
57
120
# https://github.com/marketplace/actions/alls-green#why
58
- e2e- alls-green : # This job does nothing and is only used for the branch protection
121
+ alls-green-playwright : # This job does nothing and is only used for the branch protection
59
122
if : always()
60
123
needs :
61
- - test
124
+ - test-playwright
62
125
runs-on : ubuntu-latest
63
126
steps :
64
127
- name : Decide whether the needed jobs succeeded or failed
65
128
uses : re-actors/alls-green@release/v1
66
129
with :
67
130
jobs : ${{ toJSON(needs) }}
131
+ allowed-skips : test-playwright
0 commit comments