@@ -2,12 +2,10 @@ name: E2E Test
2
2
3
3
on :
4
4
pull_request :
5
- branches :
6
- - main
7
5
workflow_call :
8
6
workflow_dispatch :
9
7
schedule :
10
- - cron : " 0 0 * * SUN"
8
+ - cron : ' 0 0 * * SUN'
11
9
12
10
permissions : {}
13
11
@@ -28,22 +26,27 @@ jobs:
28
26
steps :
29
27
- name : Checkout
30
28
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
31
- with :
32
- persist-credentials : false
33
29
34
30
- name : Install mise
35
31
uses : jdx/mise-action@5083fe46898c414b2475087cc79da59e7da859e8 # v2.1.11
36
32
with :
37
- version : 2025.1.0
38
- cache_save : ${{ github.ref_name == 'main' }}
39
- env :
40
- GITHUB_TOKEN : ${{ github.token }}
33
+ experimental : true
34
+ install : false
35
+
36
+ - name : Install mise tools
37
+ # cspell:ignore reshim
38
+ # reshim is required to avoid "No such file or directory" error
39
+ # ref: https://github.com/jdx/mise/issues/2260
40
+ run : mise install || (mise reshim && mise install)
41
+
42
+ - name : Install package.json dependencies
43
+ run : mise run buni
41
44
42
45
- name : List astro versions for E2E tests
43
46
id : list
44
47
run : |
45
- versions=$(mise run test: list-astro-versions)
46
- echo "versions=${ versions} " >> "${ GITHUB_OUTPUT} "
48
+ versions=$(bun run .github/workflows/scripts/ list-astro-versions.ts )
49
+ echo "versions=$versions" >> "$GITHUB_OUTPUT"
47
50
48
51
test-e2e-general :
49
52
needs :
@@ -63,16 +66,21 @@ jobs:
63
66
steps :
64
67
- name : Checkout
65
68
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
66
- with :
67
- persist-credentials : false
68
69
69
70
- name : Install mise
70
71
uses : jdx/mise-action@5083fe46898c414b2475087cc79da59e7da859e8 # v2.1.11
71
72
with :
72
- version : 2025.1.0
73
- cache_save : ${{ github.ref_name == 'main' }}
74
- env :
75
- GITHUB_TOKEN : ${{ github.token }}
73
+ experimental : true
74
+ install : false
75
+
76
+ - name : Install mise tools
77
+ # cspell:ignore reshim
78
+ # reshim is required to avoid "No such file or directory" error
79
+ # ref: https://github.com/jdx/mise/issues/2260
80
+ run : mise install || (mise reshim && mise install)
81
+
82
+ - name : Install package.json dependencies
83
+ run : mise run buni
76
84
77
85
- name : Build Package
78
86
run : mise run build
89
97
id : dependency-versions
90
98
run : |
91
99
playwright_version=$(bun pm ls | sed -nE 's/.*@playwright\/test@(.+)/\1/p')
92
- echo "playwright=${ playwright_version} " >> "${ GITHUB_OUTPUT} "
100
+ echo "playwright=$playwright_version" >> "$GITHUB_OUTPUT"
93
101
94
102
- name : Restore Playwright Browsers Cache
95
103
id : restore-browsers-cache
@@ -136,16 +144,21 @@ jobs:
136
144
steps :
137
145
- name : Checkout
138
146
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
139
- with :
140
- persist-credentials : false
141
147
142
148
- name : Install mise
143
149
uses : jdx/mise-action@5083fe46898c414b2475087cc79da59e7da859e8 # v2.1.11
144
150
with :
145
- version : 2025.1.0
146
- cache_save : ${{ github.ref_name == 'main' }}
147
- env :
148
- GITHUB_TOKEN : ${{ github.token }}
151
+ experimental : true
152
+ install : false
153
+
154
+ - name : Install mise tools
155
+ # cspell:ignore reshim
156
+ # reshim is required to avoid "No such file or directory" error
157
+ # ref: https://github.com/jdx/mise/issues/2260
158
+ run : mise install || (mise reshim && mise install)
159
+
160
+ - name : Install package.json dependencies
161
+ run : mise run buni
149
162
150
163
- name : Build Package
151
164
run : mise run build
@@ -156,12 +169,12 @@ jobs:
156
169
playwright_version=$(bun pm ls | sed -nE 's/.*@playwright\/test@(.+)/\1/p')
157
170
astro_version=$(bun pm ls | sed -nE 's/.*astro@(.+)/\1/p' | uniq)
158
171
# throw error if several versions are found
159
- if [[ $(echo "${ astro_version} " | wc -l) -gt 1 ]]; then
160
- echo "Multiple versions of Astro found: ${ astro_version} "
172
+ if [[ $(echo "$astro_version" | wc -l) -gt 1 ]]; then
173
+ echo "Multiple versions of Astro found: $astro_version"
161
174
exit 1
162
175
fi
163
- echo "playwright=${ playwright_version} " >> "${ GITHUB_OUTPUT} "
164
- echo "astro=${ astro_version} " >> "${ GITHUB_OUTPUT} "
176
+ echo "playwright=$playwright_version" >> "$GITHUB_OUTPUT"
177
+ echo "astro=$astro_version" >> "$GITHUB_OUTPUT"
165
178
166
179
- name : Restore Playwright Browsers Cache
167
180
id : restore-browsers-cache
@@ -188,7 +201,7 @@ jobs:
188
201
189
202
- name : Store Hash of E2E Test Fixtures and Image Service Consistency Test
190
203
id : fixtures-hash
191
- run : echo "hash=${{ hashFiles('tests/e2e/fixtures/**/*', 'tests/e2e/conversion.test.ts') }}" >> "${ GITHUB_OUTPUT} "
204
+ run : echo "hash=${{ hashFiles('tests/e2e/fixtures/**/*', 'tests/e2e/conversion.test.ts') }}" >> "$GITHUB_OUTPUT"
192
205
193
206
- name : Install E2E Test Fixtures Dependencies
194
207
run : bun install --frozen-lockfile
@@ -238,13 +251,32 @@ jobs:
238
251
name : playwright-report-conversion-${{ github.sha }}
239
252
path : playwright-report/
240
253
241
- actions-timeline :
254
+ test-e2e-status :
242
255
needs :
243
256
- test-e2e-general
244
257
- test-e2e-conversion
258
+
245
259
# skip if the workflow is called from another workflow
246
260
if : ${{ !cancelled() && contains(github.workflow_ref, '/e2e.yml') }}
247
261
262
+ runs-on : ubuntu-24.04
263
+ timeout-minutes : 5
264
+
265
+ steps :
266
+ - name : Check the status of the jobs
267
+ run : |
268
+ if [[ $(echo '${{ toJson(needs.*.result) }}' | jq 'all(. == "success")') == "false" ]]; then
269
+ echo 'Some jobs are failed, cancelled, or skipped.'
270
+ exit 1
271
+ fi
272
+ echo 'All jobs are successful.'
273
+
274
+ actions-timeline :
275
+ needs :
276
+ - test-e2e-status
277
+
278
+ if : needs.test-e2e-status.result == 'success' || needs.test-e2e-status.result == 'failure'
279
+
248
280
runs-on : ubuntu-24.04
249
281
timeout-minutes : 5
250
282
permissions :
0 commit comments