24
gradle-cache-read-only:
25
description: "Should the Gradle cache be read-only?"
28
gradle-cache-write-only:
29
description: "Should the Gradle cache be write-only?"
33
description: "Is this CI run from a public fork?"
39
runs-on: ubuntu-latest
40
name: Compile and Check Java
42
is-draft: ${{ steps.check-draft-pr.outputs.is-draft }}
47
GITHUB_CONTEXT: ${{ toJson(github) }}
48
- name: Check for Draft PR
51
github.event_name == 'pull_request' &&
52
github.event.pull_request.draft
53
run: echo "is-draft=true" >> "$GITHUB_OUTPUT"
55
uses: actions/checkout@v4
57
persist-credentials: false
58
- uses: actions/setup-python@v5
60
python-version: '3.12'
62
uses: ./.github/actions/setup-gradle
65
gradle-cache-read-only: ${{ inputs.gradle-cache-read-only }}
66
gradle-cache-write-only: ${{ inputs.gradle-cache-write-only }}
67
develocity-access-key: ${{ secrets.GE_ACCESS_TOKEN }}
68
- name: Compile and validate
70
SCAN_ARG: ${{ inputs.is-public-fork && '--no-scan' || '--scan' }}
77
./gradlew --build-cache --info $SCAN_ARG check -x test
78
- name: Archive check reports
80
uses: actions/upload-artifact@v4
86
if-no-files-found: ignore
87
- name: Annotate checkstyle errors
90
run: python .github/scripts/checkstyle.py
92
GITHUB_WORKSPACE: ${{ github.workspace }}
93
- name: Annotate Rat errors
96
run: python .github/scripts/rat.py
98
GITHUB_WORKSPACE: ${{ github.workspace }}
102
if: ${{ ! needs.validate.outputs.is-draft }}
103
runs-on: ubuntu-latest
108
name: JUnit tests Java ${{ matrix.java }}
110
- name: Checkout code
111
uses: actions/checkout@v4
113
persist-credentials: false
114
- uses: actions/setup-python@v5
116
python-version: '3.12'
117
- run: pip install -r .github/scripts/requirements.txt
119
uses: ./.github/actions/setup-gradle
121
java-version: ${{ matrix.java }}
122
gradle-cache-read-only: ${{ inputs.gradle-cache-read-only }}
123
gradle-cache-write-only: ${{ inputs.gradle-cache-write-only }}
124
develocity-access-key: ${{ secrets.GE_ACCESS_TOKEN }}
136
./.github/scripts/thread-dump.sh &
137
timeout ${TIMEOUT_MINUTES}m ./gradlew --build-cache --continue --no-scan \
138
-PtestLoggingEvents=started,passed,skipped,failed \
139
-PmaxParallelForks=2 \
140
-PmaxTestRetries=1 -PmaxTestRetryFailures=3 \
141
-PmaxQuarantineTestRetries=3 -PmaxQuarantineTestRetryFailures=0 \
142
-PcommitId=xxxxxxxxxxxxxxxx \
145
echo "exitcode=$exitcode" >> $GITHUB_OUTPUT
146
- name: Archive JUnit HTML reports
147
uses: actions/upload-artifact@v4
148
id: junit-upload-artifact
150
name: junit-reports-${{ matrix.java }}
152
**/build/reports/tests/*
154
if-no-files-found: ignore
155
- name: Archive JUnit XML
156
uses: actions/upload-artifact@v4
158
name: junit-xml-${{ matrix.java }}
160
build/junit-xml/**/*.xml
162
if-no-files-found: ignore
163
- name: Archive Thread Dumps
164
id: thread-dump-upload-artifact
165
if: always() && steps.junit-test.outputs.exitcode == '124'
166
uses: actions/upload-artifact@v4
168
name: junit-thread-dumps-${{ matrix.java }}
172
if-no-files-found: ignore
173
- name: Parse JUnit tests
174
run: python .github/scripts/junit.py --export-test-catalog ./test-catalog >> $GITHUB_STEP_SUMMARY
176
GITHUB_WORKSPACE: ${{ github.workspace }}
177
JUNIT_REPORT_URL: ${{ steps.junit-upload-artifact.outputs.artifact-url }}
178
THREAD_DUMP_URL: ${{ steps.thread-dump-upload-artifact.outputs.artifact-url }}
179
GRADLE_EXIT_CODE: ${{ steps.junit-test.outputs.exitcode }}
180
- name: Archive Test Catalog
181
if: ${{ always() && matrix.java == '21' }}
182
uses: actions/upload-artifact@v4
187
if-no-files-found: ignore
188
- name: Archive Build Scan
190
uses: actions/upload-artifact@v4
192
name: build-scan-test-${{ matrix.java }}
193
path: ~/.gradle/build-scan-data
195
if-no-files-found: ignore