@@ -247,75 +247,6 @@ jobs:
247
247
steps :
248
248
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
249
249
250
- - name : Free disk space
251
- run : .github/scripts/gha-free-disk-space.sh
252
-
253
- - id : setup-test-java
254
- name : Set up JDK ${{ matrix.test-java-version }}-${{ matrix.vm }} for running tests
255
- uses : actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
256
- with :
257
- # using zulu because new releases get published quickly
258
- distribution : ${{ matrix.vm == 'hotspot' && 'zulu' || 'adopt-openj9'}}
259
- java-version : ${{ matrix.test-java-version }}
260
-
261
- - name : Set up JDK for running Gradle
262
- uses : actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
263
- with :
264
- distribution : temurin
265
- java-version-file : .java-version
266
-
267
- # vaadin 14 tests fail with node 18
268
- - name : Set up Node
269
- uses : actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
270
- with :
271
- node-version : 16
272
-
273
- # vaadin tests use pnpm
274
- - name : Cache pnpm modules
275
- uses : actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
276
- with :
277
- path : ~/.pnpm-store
278
- key : ${{ runner.os }}-test-cache-pnpm-modules
279
-
280
- - name : Start deadlock detector
281
- run : .github/scripts/deadlock-detector.sh
282
-
283
- - name : Setup Gradle
284
- uses : gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4.3.0
285
- with :
286
- # only push cache for one matrix option since github action cache space is limited
287
- cache-read-only : ${{ inputs.cache-read-only || matrix.test-java-version != 11 || matrix.vm != 'hotspot' }}
288
-
289
- - name : List tests
290
- # "check" is needed to activate all tests for listing purposes
291
- # listTestsInPartition writes test tasks that apply to the given partition to a file named
292
- # "test-tasks.txt" and then disables all tasks (including tests) after it runs
293
- run : >
294
- ./gradlew
295
- check -x spotlessCheck
296
- listTestsInPartition
297
- -PtestPartition=${{ matrix.test-partition }}
298
-
299
- - name : Set test tasks
300
- run : |
301
- echo "test-tasks=$(cat test-tasks.txt | xargs echo | sed 's/\n/ /g')" >> $GITHUB_ENV
302
-
303
- - name : Test
304
- # spotless is checked separately since it's a common source of failure
305
- run : >
306
- ./gradlew
307
- ${{ env.test-tasks }}
308
- -PtestJavaVersion=${{ matrix.test-java-version }}
309
- -PtestJavaVM=${{ matrix.vm }}
310
- -Porg.gradle.java.installations.paths=${{ steps.setup-test-java.outputs.path }}
311
- -Porg.gradle.java.installations.auto-download=false
312
- ${{ inputs.no-build-cache && ' --no-build-cache' || '' }}
313
- ${{ inputs.max-test-retries && format(' -PmaxTestRetries={0}', inputs.max-test-retries) || '' }}
314
-
315
- - name : Build scan
316
- if : ${{ !cancelled() && hashFiles('build-scan.txt') != '' }}
317
- run : cat build-scan.txt
318
-
319
250
- name : Get current job url
320
251
id : jobs
321
252
if : ${{ !cancelled() }}
@@ -325,47 +256,28 @@ jobs:
325
256
with :
326
257
result-encoding : string
327
258
script : |
328
- const { data: workflow_run } = await github.rest.actions.listJobsForWorkflowRun({
329
- owner: context.repo.owner,
330
- repo: context.repo.repo,
331
- run_id: context.runId,
332
- per_page: 100
333
- });
259
+ const workflow_jobs_nested = await github.paginate(
260
+ github.rest.actions.listJobsForWorkflowRun,
261
+ {
262
+ owner: context.repo.owner,
263
+ repo: context.repo.repo,
264
+ run_id: context.runId,
265
+ per_page: 100
266
+ },
267
+ (response) => {
268
+ return response.data.jobs;
269
+ },
270
+ );
271
+ console.log("====================");
272
+ console.log(workflow_jobs_nested);
273
+ console.log("====================");
274
+ console.log(workflow_jobs_nested.flat());
275
+ console.log("====================");
276
+ console.log(workflow_jobs_nested.flat().find((job) => job.name === job_name));
277
+ console.log("====================");
334
278
const matrix = JSON.parse(process.env.matrix);
335
279
const job_name = `common / test${ matrix['test-partition'] } (${ matrix['test-java-version'] }, ${ matrix.vm })`;
336
- return workflow_run.jobs.find((job) => job.name === job_name).html_url;
337
-
338
- - name : Flaky test report
339
- if : ${{ !cancelled() }}
340
- env :
341
- FLAKY_TEST_REPORTER_ACCESS_KEY : ${{ secrets.FLAKY_TEST_REPORTER_ACCESS_KEY }}
342
- JOB_URL : ${{ steps.jobs.outputs.result }}
343
- run : |
344
- if [ -s build-scan.txt ]; then
345
- export BUILD_SCAN_URL=$(cat build-scan.txt)
346
- fi
347
- ./gradlew :test-report:reportFlakyTests
348
-
349
- - name : Upload deadlock detector artifacts if any
350
- if : failure()
351
- uses : actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
352
- with :
353
- name : deadlock-detector-test-${{ matrix.test-java-version }}-${{ matrix.vm }}-${{ matrix.test-partition }}
354
- path : /tmp/deadlock-detector-*
355
- if-no-files-found : ignore
356
-
357
- - name : Upload jvm crash dump files if any
358
- if : failure()
359
- uses : actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
360
- with :
361
- name : javacore-test-${{ matrix.test-java-version }}-${{ matrix.test-partition }}
362
- path : |
363
- **/hs_err_pid*.log
364
- **/javacore.*.txt
365
- **/Snap.*.trc
366
- **/core.*.dmp
367
- **/jitdump.*.dmp
368
- if-no-files-found : ignore
280
+ return workflow_jobs_nested.flat().find((job) => job.name === job_name).html_url;
369
281
370
282
smoke-test :
371
283
runs-on : ${{ matrix.os }}
0 commit comments