@@ -42,14 +42,13 @@ jobs:
4242 - 'java-cloud-bom/**'
4343 - 'sdk-platform-java/**'
4444 - 'google-auth-library-java/**'
45- units :
45+ dependencies :
4646 needs : filter
4747 if : ${{ needs.filter.outputs.library == 'true' }}
4848 runs-on : ubuntu-latest
4949 strategy :
50- fail-fast : false
5150 matrix :
52- java : [11, 17, 21 ]
51+ java : [17 ]
5352 steps :
5453 - uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
5554 with :
@@ -60,135 +59,112 @@ jobs:
6059 java-version : ${{matrix.java}}
6160 cache : ' maven'
6261 - run : java -version
63- - name : Pre-install all BOM modules to populate local cache
64- run : bash java-cloud-bom/tests/pre-install.sh
65- shell : bash
66- - run : .kokoro/build.sh
67- env :
68- JOB_TYPE : test
69- GH_TOKEN : ${{ github.token }}
70- units-java8 :
62+ - name : Install modules locally
63+ run : mvn install -B -ntp -Pquick-build -DskipTests=true -T 1C
64+ - run : .kokoro/dependencies.sh
65+
66+ bom-content-test :
7167 needs : filter
72- if : ${{ needs.filter.outputs.library == 'true' }}
73- # Building using Java 17 and run the tests with Java 8 runtime
74- name : " units (8)"
68+ if : ${{ needs.filter.outputs.library == 'true' && github.repository_owner == 'googleapis' }}
7569 runs-on : ubuntu-latest
7670 steps :
77- - uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
78- with :
79- persist-credentials : false
80- - uses : actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0
81- with :
82- java-version : 8
83- distribution : temurin
84- cache : ' maven'
85- - name : " Set jvm system property environment variable for surefire plugin (unit tests)"
86- # Maven surefire plugin (unit tests) allows us to specify JVM to run the tests.
87- # https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm
88- run : echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java -P !java17" >> $GITHUB_ENV
89- shell : bash
90- - uses : actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0
91- with :
92- java-version : 17
93- distribution : temurin
94- cache : ' maven'
95- - name : Pre-install all BOM modules to populate local cache
96- run : bash java-cloud-bom/tests/pre-install.sh
97- shell : bash
98- - run : .kokoro/build.sh
99- env :
100- JOB_TYPE : test
101- GH_TOKEN : ${{ github.token }}
102- windows :
103- needs : filter
104- if : ${{ needs.filter.outputs.library == 'true' }}
105- runs-on : windows-latest
106- steps :
107- - name : Support longpaths
108- run : git config --system core.longpaths true
10971 - uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
11072 with :
11173 persist-credentials : false
11274 - uses : actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0
11375 with :
11476 distribution : temurin
115- java-version : 8
116- cache : ' maven'
77+ java-version : 11
78+ cache : maven
11779 - run : java -version
118- - name : Pre-install all BOM modules to populate local cache
119- run : bash java-cloud-bom/tests/pre-install.sh
120- shell : bash
121- - run : .kokoro/build.sh
122- env :
123- JOB_TYPE : test
124- GH_TOKEN : ${{ github.token }}
125- dependencies :
80+ - name : Install modules locally
81+ run : mvn install -B -ntp -Pquick-build -DskipTests=true -T 1C
82+ - name : Install BOMs
83+ run : |
84+ mvn -B -V -ntp install -f java-cloud-bom/pom.xml -DskipTests
85+ - name : Ensure the members of the Libraries BOM exist in Maven Central
86+ uses : ./java-cloud-bom/tests/validate-bom
87+ with :
88+ bom-path : java-cloud-bom/libraries-bom/pom.xml
89+ - name : Ensure the BOM has valid content (at releases)
90+ if : github.head_ref == 'release-please--branches--main'
91+ run : |
92+ mvn -B -V -ntp verify -Dtest="BomContentTest#testLibrariesBom"
93+ working-directory : java-cloud-bom/tests
94+
95+ bom-assertion-test :
12696 needs : filter
127- if : ${{ needs.filter.outputs.library == 'true' }}
97+ if : ${{ needs.filter.outputs.library == 'true' && github.repository_owner == 'googleapis' }}
98+ name : BomContentAssertionsTest (Test for assertion logic in BomContentTest)
12899 runs-on : ubuntu-latest
129- strategy :
130- matrix :
131- java : [17]
132100 steps :
133101 - uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
134102 with :
135103 persist-credentials : false
136104 - uses : actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0
137105 with :
138- distribution : temurin
139- java-version : ${{matrix.java}}
140- cache : ' maven'
106+ distribution : zulu
107+ java-version : 11
141108 - run : java -version
142- - name : Pre-install all BOM modules to populate local cache
143- run : bash java-cloud-bom/tests/pre-install.sh
144- shell : bash
145- - run : .kokoro/dependencies.sh
146- javadoc :
109+ - name : Install modules locally
110+ run : mvn install -B -ntp -Pquick-build -DskipTests=true -T 1C
111+ - name : Install BOMs
112+ run : |
113+ mvn -B -V -ntp install -f java-cloud-bom/pom.xml -DskipTests
114+ - run : |
115+ mvn -B -V -ntp verify -Dtest="BomContentAssertionsTest"
116+ working-directory: java-cloud-bom/tests
117+
118+ test-invalid-bom :
147119 needs : filter
148120 if : ${{ needs.filter.outputs.library == 'true' }}
149121 runs-on : ubuntu-latest
150122 steps :
151123 - uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
152124 with :
153125 persist-credentials : false
154- - uses : actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0
126+ - name : Fetch the bad protobuf-bom version 3.22.1
127+ shell : bash
128+ # 3.22.1 had a issue in their pom.xml
129+ # https://github.com/protocolbuffers/protobuf/issues/12170
130+ run : |
131+ mkdir -p bad-protobuf-bom
132+ curl https://repo1.maven.org/maven2/com/google/protobuf/protobuf-bom/3.22.1/protobuf-bom-3.22.1.pom \
133+ --output bad-protobuf-bom/pom.xml
134+ - name : Check the bad BOM
135+ uses : ./java-cloud-bom/tests/validate-bom
136+ id : validate-bom
155137 with :
156- distribution : temurin
157- java-version : 17
158- cache : ' maven'
159- - run : java -version
160- - name : Pre-install all BOM modules to populate local cache
161- run : bash java-cloud-bom/tests/pre-install.sh
138+ bom-path : bad-protobuf-bom/pom.xml
139+ continue-on-error : true
140+ - name : Ensure the validate-bom invalidated the bad BOM
162141 shell : bash
163- - run : .kokoro/build.sh
164- env :
165- JOB_TYPE : javadoc
166- lint :
142+ if : steps.validate-bom.outcome != 'failure'
143+ run : |
144+ echo "The validate-bom check should have invalidated the bad BOM"
145+ exit 1
146+
147+ dashboard :
167148 needs : filter
168149 if : ${{ needs.filter.outputs.library == 'true' }}
169150 runs-on : ubuntu-latest
170151 steps :
171152 - uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
172153 with :
173- fetch-depth : 0
174154 persist-credentials : false
175155 - uses : actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0
176156 with :
177157 distribution : temurin
178158 java-version : 11
179- cache : ' maven'
159+ cache : maven
180160 - run : java -version
181- - name : Pre-install all BOM modules to populate local cache
182- run : bash java-cloud-bom/tests/pre-install.sh
183- shell : bash
184- - run : .kokoro/build.sh
161+ - run : .kokoro/dashboard.sh
185162 env :
186- JOB_TYPE : lint
187- HEAD_SHA : ${{ github.event.pull_request.head.sha || github.sha }}
188- BASE_SHA : ${{ github.event.pull_request.base.sha || github.event.before }}
189- clirr :
163+ JOB_TYPE : dashboard-units-check
164+
165+ shared-dependencies-convergence :
190166 needs : filter
191- if : ${{ needs.filter.outputs.library == 'true' }}
167+ if : ${{ needs.filter.outputs.library == 'true' && github.repository_owner == 'googleapis' && github.head_ref == 'release-please--branches--main' }}
192168 runs-on : ubuntu-latest
193169 steps :
194170 - uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
@@ -198,12 +174,9 @@ jobs:
198174 with :
199175 distribution : temurin
200176 java-version : 11
201- cache : ' maven'
177+ cache : maven
202178 - run : java -version
203- - name : Pre-install all BOM modules to populate local cache
204- run : bash java-cloud-bom/tests/pre-install.sh
205- shell : bash
206- - run : .kokoro/build.sh
179+ - run : .kokoro/dashboard.sh
207180 env :
208- JOB_TYPE : clirr
209- BUILD_SUBDIR : java-cloud-bom
181+ JOB_TYPE : dependency-convergence-check
182+
0 commit comments