@@ -14,48 +14,28 @@ concurrency:
1414 cancel-in-progress : ${{ github.event_name == 'pull_request' }}
1515
1616jobs :
17- # Jars, plugins and tests. No GraalVM: the native image is gated out of the lifecycle
18- # tasks (see rootProject.build.gradle) so this job never needs a GraalVM toolchain.
1917 build :
2018 name : build
2119 runs-on : ubuntu-latest
2220 steps :
2321 - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
24- with :
25- # gradle-git-version derives the project version from `git describe`,
26- # so it needs the full history and all tags.
27- fetch-depth : 0
2822
29- # Everything the jars are built with. Gradle provisions no JDKs of its own —
30- # auto-download is off in gradle.properties — so JDK21_HOME is the toolchain it reads.
3123 - name : Install JDK 21
3224 uses : actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
3325 with :
3426 distribution : temurin
3527 java-version : ' 21'
3628
37- - name : Point Gradle at the JDK
38- run : echo "JDK21_HOME=${JAVA_HOME_21_X64:-$JAVA_HOME_21_ARM64}" >> "$GITHUB_ENV"
39-
4029 - name : Build
41- run : ./gradlew --stacktrace build
42-
43- - name : Upload jars and plugin distributions
44- uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
45- with :
46- name : jars
47- path : |
48- */build/libs/*.jar
49- idea-plugin/build/distributions/*.zip
50- if-no-files-found : error
30+ run : ./gradlew test
5131
52- - name : Upload test results
53- if : always()
54- uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
32+ - name : Publish Test Report
33+ uses : mikepenz/action-junit-report@d9f48fc87bc235f7e214acf696ca5abc0a986f16 # v6.4.2
34+ if : ${{ !cancelled() }}
5535 with :
56- name : test-results-build
57- path : ' **/build/test-results/**/*.xml '
58- if-no-files-found : warn
36+ report_paths : ' **/build/ test-results/test/*.xml '
37+ annotate_only : true
38+ job_summary : true
5939
6040 # One explicit job per target, so every binary we ship is traceable to a named run.
6141 native :
6949 include :
7050 - platform : linux-x86-64
7151 runner : ubuntu-latest
72- # The tests that drive the binary run once, on the cheapest runner, rather
73- # than on all four: they are TestKit suites and spawn a Gradle build each.
74- nativeTests : true
7552 - platform : linux-aarch64
7653 runner : ubuntu-24.04-arm
7754 - platform : macos-aarch64
@@ -81,42 +58,25 @@ jobs:
8158
8259 steps :
8360 - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
84- with :
85- fetch-depth : 0
8661
87- # GraalVM 25 compiles the image and nothing else. The binary ships standalone, so it
88- # owes nobody backwards compatibility — which is what buys the newer compiler and
89- # --exact-reachability-metadata, a GraalVM 23+ option.
9062 - name : Install GraalVM 25 for the image
9163 uses : graalvm/setup-graalvm@5298d94fb55a4f185c602eeac5de1b553882abe2 # v1.6.4
9264 with :
9365 java-version : ' 25'
9466 distribution : ' graalvm-community'
9567 github-token : ${{ secrets.GITHUB_TOKEN }}
9668
97- # After GraalVM, so JAVA_HOME — and the Gradle daemon — is 21 like everywhere else, and
98- # so the jars this job feeds into native-image are compiled at 21. GRAALVM_HOME survives.
99- - name : Install JDK 21 for the jars
100- uses : actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
101- with :
102- distribution : temurin
103- java-version : ' 21'
104-
105- - name : Point Gradle at the JDKs
106- run : echo "JDK21_HOME=${JAVA_HOME_21_X64:-$JAVA_HOME_21_ARM64}" >> "$GITHUB_ENV"
107-
10869 - name : Compile the native image
109- run : ./gradlew --stacktrace -PnativeImage=true :palantir-java-format-native:nativeCompile
110-
111- # These reach the binary through a resolved configuration rather than a task dependency,
112- # so they only work with -PnativeImage=true. Excluded from the `build` job for that reason.
113- - name : Run the tests that drive the native binary
114- if : matrix.nativeTests
115- run : ./gradlew --stacktrace -PnativeImage=true :palantir-java-format-jdk-bootstrap:test :gradle-palantir-java-format:test
116-
117- - name : Upload native image
118- uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
70+ run : |
71+ ./gradlew -PnativeImage=true \
72+ :palantir-java-format-native:nativeCompile \
73+ :palantir-java-format-jdk-bootstrap:test \
74+ :gradle-palantir-java-format:test
75+
76+ - name : Publish Test Report
77+ uses : mikepenz/action-junit-report@d9f48fc87bc235f7e214acf696ca5abc0a986f16 # v6.4.2
78+ if : ${{ !cancelled() }}
11979 with :
120- name : native-image-${{ matrix.platform }}
121- path : palantir-java-format-native/build/native/nativeCompile/*
122- if-no-files-found : error
80+ report_paths : ' **/build/test-results/test/*.xml '
81+ annotate_only : true
82+ job_summary : true
0 commit comments