Skip to content

Commit 815a490

Browse files
cpovirkGoogle Java Core Libraries
authored andcommitted
Build Truth and its Javadoc under Java 26, and test under {8, 17, 25} instead of {8, 11}.
This half-matches Guava, where: - We build under Java 26, albeit with a different approach (cl/711476575, cl/711746683). - We test under those versions plus 11, I think because we do some stuff with old versions of Gradle there (cl/912590939). Motivation: - Newer javac and javadoc binaries are good. - Building on a version higher than Java 8 is necessary for module support (#1601). - We will hopefully someday want to conditionally use newer libraries. RELNOTES=n/a PiperOrigin-RevId: 916187164
1 parent b02fbe1 commit 815a490

1 file changed

Lines changed: 42 additions & 16 deletions

File tree

.github/workflows/ci.yml

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@ on:
99
- master
1010

1111
jobs:
12-
test:
13-
name: "JDK ${{ matrix.java }}"
14-
strategy:
15-
matrix:
16-
java: [ 8, 11 ]
12+
build:
13+
name: 'Build with JDK 26'
1714
runs-on: ubuntu-latest
1815
steps:
1916
# Cancel any previous runs for the same branch that are still running.
@@ -23,34 +20,63 @@ jobs:
2320
access_token: ${{ github.token }}
2421
- name: 'Check out repository'
2522
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
26-
- name: 'Set up JDK ${{ matrix.java }}'
23+
- name: 'Set up JDK 26 for compilation'
2724
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654
2825
with:
29-
java-version: ${{ matrix.java }}
26+
java-version: 26
3027
distribution: 'temurin'
3128
cache: 'maven'
3229
- name: 'Install'
3330
shell: bash
3431
run: mvn -B -P!standard-with-extra-repos install -U -DskipTests=true
35-
- name: 'Test'
36-
shell: bash
37-
run: mvn -B -P!standard-with-extra-repos verify -U -Dmaven.javadoc.skip=true
3832
- name: 'Javadoc Test Run'
3933
shell: bash
4034
run: mvn -B -P!standard-with-extra-repos javadoc:aggregate -U
35+
- name: 'Upload build artifacts'
36+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
37+
with:
38+
name: truth-jars
39+
path: |
40+
**/target/*.jar
41+
!**/target/*-sources.jar
42+
!**/target/*-javadoc.jar
43+
44+
test:
45+
name: "Test with JDK ${{ matrix.java }}"
46+
needs: build
47+
strategy:
48+
matrix:
49+
java: [ 8, 17, 25 ]
50+
runs-on: ubuntu-latest
51+
steps:
52+
- name: 'Check out repository'
53+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
54+
- name: 'Set up JDK ${{ matrix.java }} for testing'
55+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654
56+
with:
57+
java-version: ${{ matrix.java }}
58+
distribution: 'temurin'
59+
cache: 'maven'
60+
- name: 'Download build artifacts'
61+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
62+
with:
63+
name: truth-jars
64+
- name: 'Test'
65+
shell: bash
66+
run: mvn -B -P!standard-with-extra-repos verify -U -Dmaven.javadoc.skip=true -Dmaven.main.skip=true
4167

4268
publish_snapshot:
4369
name: 'Publish snapshot'
44-
needs: test
70+
needs: [build, test]
4571
if: github.event_name == 'push' && github.repository == 'google/truth'
4672
runs-on: ubuntu-latest
4773
steps:
4874
- name: 'Check out repository'
4975
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
50-
- name: 'Set up JDK 11'
76+
- name: 'Set up JDK 26'
5177
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654
5278
with:
53-
java-version: 11
79+
java-version: 26
5480
distribution: 'temurin'
5581
cache: 'maven'
5682
server-id: central
@@ -66,16 +92,16 @@ jobs:
6692
permissions:
6793
contents: write
6894
name: 'Generate latest docs'
69-
needs: test
95+
needs: [build, test]
7096
if: github.event_name == 'push' && github.repository == 'google/truth'
7197
runs-on: ubuntu-latest
7298
steps:
7399
- name: 'Check out repository'
74100
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
75-
- name: 'Set up JDK 11'
101+
- name: 'Set up JDK 26'
76102
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654
77103
with:
78-
java-version: 11
104+
java-version: 26
79105
distribution: 'temurin'
80106
cache: 'maven'
81107
- name: 'Generate latest docs'

0 commit comments

Comments
 (0)