-
Notifications
You must be signed in to change notification settings - Fork 919
134 lines (117 loc) · 4.21 KB
/
reusable-test-latest-deps.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Reusable - Test latest deps
on:
workflow_call:
inputs:
cache-read-only:
type: boolean
required: false
no-build-cache:
type: boolean
required: false
secrets:
FLAKY_TEST_REPORTER_ACCESS_KEY:
required: false
permissions:
contents: read
jobs:
test-latest-deps:
name: testLatestDeps${{ matrix.test-partition }}
runs-on: ubuntu-latest
strategy:
matrix:
test-partition:
- 0
- 1
- 2
- 3
fail-fast: false
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Free disk space
run: .github/scripts/gha-free-disk-space.sh
- name: Set up JDK for running Gradle
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
with:
distribution: temurin
java-version-file: .java-version
- name: Increase gradle daemon heap size
run: |
sed -i "s/org.gradle.jvmargs=/org.gradle.jvmargs=-Xmx3g /" gradle.properties
# vaadin tests use pnpm
- name: Cache pnpm modules
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-test-latest-cache-pnpm-modules
- name: Start deadlock detector
run: .github/scripts/deadlock-detector.sh
- name: Setup Gradle
uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4.3.0
with:
cache-read-only: ${{ inputs.cache-read-only }}
- name: List tests
run: >
./gradlew
check -x spotlessCheck
listTestsInPartition
-PtestPartition=${{ matrix.test-partition }}
-PtestLatestDeps=true
- name: Set test tasks
run: |
echo "test-tasks=$(cat test-tasks.txt | xargs echo | sed 's/\n/ /g')" >> $GITHUB_ENV
- name: Test
run: >
./gradlew
${{ env.test-tasks }}
-PtestLatestDeps=true
${{ inputs.no-build-cache && ' --no-build-cache' || '' }}
- name: Build scan
if: ${{ !cancelled() && hashFiles('build-scan.txt') != '' }}
run: cat build-scan.txt
- name: Get current job url
id: jobs
if: ${{ !cancelled() }}
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
env:
matrix: ${{ toJson(matrix) }}
with:
result-encoding: string
script: |
const { data: workflow_run } = await github.rest.actions.listJobsForWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.runId,
per_page: 100
});
const matrix = JSON.parse(process.env.matrix);
const job_name = `test-latest-deps / testLatestDeps${ matrix['test-partition'] }`;
return workflow_run.jobs.find((job) => job.name === job_name).html_url;
- name: Flaky test report
if: ${{ !cancelled() }}
env:
FLAKY_TEST_REPORTER_ACCESS_KEY: ${{ secrets.FLAKY_TEST_REPORTER_ACCESS_KEY }}
JOB_URL: ${{ steps.jobs.outputs.result }}
run: |
if [ -s build-scan.txt ]; then
export BUILD_SCAN_URL=$(cat build-scan.txt)
fi
./gradlew :test-report:reportFlakyTests
- name: Upload deadlock detector artifacts if any
if: failure()
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
with:
name: deadlock-detector-test-latest-${{ matrix.test-java-version }}-${{ matrix.vm }}-${{ matrix.test-partition }}
path: /tmp/deadlock-detector-*
if-no-files-found: ignore
- name: Upload jvm crash dump files if any
if: failure()
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
with:
name: javacore-test-latest-${{ matrix.test-java-version }}-${{ matrix.test-partition }}
path: |
**/hs_err_pid*.log
**/javacore.*.txt
**/Snap.*.trc
**/core.*.dmp
**/jitdump.*.dmp
if-no-files-found: ignore