2323 runs-on : ubuntu-latest
2424
2525 steps :
26- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2 .2
27- - uses : zgosalvez/github-actions-ensure-sha-pinned-actions@38608ef4fb69adae7f1eac6eeb88e67b7d083bfd # v3 .0.16
26+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0 .2
27+ - uses : zgosalvez/github-actions-ensure-sha-pinned-actions@70c4af2ed5282c51ba40566d026d6647852ffa3e # v5 .0.1
2828
2929 check :
3030 name : Run code quality check
@@ -33,20 +33,20 @@ jobs:
3333
3434 steps :
3535 - name : Checkout
36- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2 .2
36+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0 .2
3737 with :
3838 fetch-depth : 0
3939 - name : Setup pnpm
40- uses : pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0 .0
40+ uses : pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2 .0
4141 - name : Setup node
42- uses : actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1 .0
42+ uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3 .0
4343 with :
4444 node-version-file : " .nvmrc"
4545 cache : " pnpm"
4646 - name : Get sha of main
4747 run : echo "main_sha=$(git rev-parse origin/main)" >> $GITHUB_ENV
4848 - name : Restore Turbo Cache
49- uses : actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2 .3
49+ uses : actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0 .3
5050 with :
5151 path : node_modules/.cache/turbo
5252 # NOTE: We create new cache record for every new commit on main
8484 mx_tools_cache_key : mx-tools-cache:${{ steps.readfile.outputs.mxversion }}
8585 steps :
8686 - name : Checkout
87- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2 .2
87+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0 .2
8888 with :
8989 fetch-depth : 1
9090 - name : Set job outputs
@@ -109,20 +109,20 @@ jobs:
109109
110110 steps :
111111 - name : Checkout
112- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2 .2
112+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0 .2
113113 with :
114114 fetch-depth : 0
115115 - name : Setup pnpm
116- uses : pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0 .0
116+ uses : pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2 .0
117117 - name : Setup node
118- uses : actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1 .0
118+ uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3 .0
119119 with :
120120 node-version-file : " .nvmrc"
121121 cache : " pnpm"
122122 - name : Get sha of main
123123 run : echo "main_sha=$(git rev-parse origin/main)" >> ${{ runner.os == 'Windows' && '$env:GITHUB_ENV' || '$GITHUB_ENV' }}
124124 - name : Restore Turbo Cache
125- uses : actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2 .3
125+ uses : actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0 .3
126126 with :
127127 path : node_modules/.cache/turbo
128128 # NOTE: build & release tasks should have their own cache
@@ -140,11 +140,43 @@ jobs:
140140 # Limit memory to avoid out of memory issues
141141 NODE_OPTIONS : " --max-old-space-size=5120 --max_old_space_size=5120"
142142
143+ e2e-plan :
144+ name : Plan E2E matrix
145+ runs-on : ubuntu-latest
146+ needs : [check-sha]
147+ # Same gate as the e2e job
148+ if : >-
149+ ${{ github.event_name == 'push' ||
150+ github.event_name == 'pull_request' &&
151+ github.event.pull_request.head.repo.full_name == 'mendix/web-widgets' }}
152+ outputs :
153+ matrix : ${{ steps.compute.outputs.matrix }}
154+ steps :
155+ - name : Checkout
156+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
157+ with :
158+ fetch-depth : 0
159+ - name : Setup pnpm
160+ uses : pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
161+ - name : Setup node
162+ uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
163+ with :
164+ node-version-file : " .nvmrc"
165+ cache : " pnpm"
166+ - name : Install dependencies
167+ run : pnpm install
168+ - name : Compute matrix
169+ id : compute
170+ run : |
171+ matrix=$(node ./automation/run-e2e/bin/run-e2e-in-chunks.mjs --print-matrix --event-name ${{ github.event_name }})
172+ echo "matrix=$matrix" >> $GITHUB_OUTPUT
173+
143174 e2e :
144175 name : Run automated end-to-end tests
145176 needs :
146177 - check-sha
147178 - mxversion
179+ - e2e-plan
148180 # Run job only if it's push to main or PR from web-widgets, don't run for fork PRs
149181 if : >-
150182 ${{ github.event_name == 'push' ||
@@ -163,14 +195,11 @@ jobs:
163195 strategy :
164196 # when one test fails, DO NOT cancel the other
165197 fail-fast : false
166- matrix :
167- index : [0, 1, 2, 3]
168- include :
169- - chunks : 4
198+ matrix : ${{ fromJSON(needs.e2e-plan.outputs.matrix) }}
170199
171200 steps :
172201 - name : Download mxtools cache
173- uses : actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2 .3
202+ uses : actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0 .3
174203 id : cache
175204 with :
176205 path : |
@@ -185,20 +214,20 @@ jobs:
185214 docker load --input ${{ env.MXRUNTIME_PATH }}
186215 docker image ls -a
187216 - name : Checkout
188- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2 .2
217+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0 .2
189218 with :
190219 fetch-depth : 0
191220 - name : Setup pnpm
192- uses : pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0 .0
221+ uses : pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2 .0
193222 - name : Setup node
194- uses : actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1 .0
223+ uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3 .0
195224 with :
196225 node-version-file : " .nvmrc"
197226 cache : " pnpm"
198227 - name : Get sha of main
199228 run : echo "main_sha=$(git rev-parse origin/main)" >> ${{ runner.os == 'Windows' && '$env:GITHUB_ENV' || '$GITHUB_ENV' }}
200229 - name : Restore Turbo Cache
201- uses : actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2 .3
230+ uses : actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0 .3
202231 with :
203232 path : node_modules/.cache/turbo
204233 key : turbo-cache-${{ runner.os }}-e2e-chunk-${{ matrix.index }}-${{ env.main_sha }}
@@ -213,28 +242,60 @@ jobs:
213242 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
214243 run : >-
215244 node ./automation/run-e2e/bin/run-e2e-in-chunks.mjs --chunks ${{ matrix.chunks }} --index ${{ matrix.index }} --event-name ${{ github.event_name }}
216- - name : Check file existence
217- id : check_files
218- uses : andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
219- with :
220- files : " ./automation/run-e2e/ctrf/*.json"
245+ - name : " Upload CTRF reports"
246+ uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
221247 if : always()
222- - name : " Generating Github Test Summary"
223- if : steps.check_files.outputs.files_exists == 'true'
224- run : |
225- pnpm --filter run-e2e run report:merge
226- pnpm dlx github-actions-ctrf custom ./automation/run-e2e/ctrf/merged-report.json ./automation/run-e2e/ctrf-custom-template/custom-summary.hbs
248+ with :
249+ name : ctrf-reports-${{ matrix.index }}
250+ path : ./automation/run-e2e/ctrf/*.json
251+ if-no-files-found : ignore
227252 - name : " Fixing files permissions"
228253 if : failure()
229254 run : |
230255 sudo find ${{ github.workspace }}/packages/* -type d -exec chmod 755 {} \;
231256 sudo find ${{ github.workspace }}/packages/* -type f -exec chmod 644 {} \;
232257 - name : " Archive test screenshot diff results"
233- uses : actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
258+ uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
234259 if : failure()
235260 with :
236261 name : test-screenshot-results-${{ matrix.index }}
237262 path : |
238263 ${{ github.workspace }}/packages/**/**/test-results/**/*.png
239264 ${{ github.workspace }}/packages/**/**/test-results/**/*.zip
240265 if-no-files-found : error
266+
267+ e2e-report :
268+ name : Publish E2E test summary
269+ runs-on : ubuntu-latest
270+ needs : [e2e]
271+ if : always()
272+ steps :
273+ - name : Checkout
274+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
275+ with :
276+ fetch-depth : 1
277+ - name : Setup pnpm
278+ uses : pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
279+ - name : Setup node
280+ uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
281+ with :
282+ node-version-file : " .nvmrc"
283+ cache : " pnpm"
284+ - name : Install dependencies
285+ run : pnpm install
286+ - name : Download CTRF reports from all chunks
287+ uses : actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
288+ with :
289+ pattern : ctrf-reports-*
290+ path : ./automation/run-e2e/ctrf
291+ merge-multiple : true
292+ - name : Check file existence
293+ id : check_files
294+ uses : andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
295+ with :
296+ files : " ./automation/run-e2e/ctrf/*.json"
297+ - name : Generate test summary
298+ if : steps.check_files.outputs.files_exists == 'true'
299+ run : |
300+ pnpm --filter run-e2e run report:merge
301+ pnpm dlx github-actions-ctrf custom ./automation/run-e2e/ctrf/merged-report.json ./automation/run-e2e/ctrf-custom-template/custom-summary.hbs
0 commit comments