@@ -28,9 +28,7 @@ name: 'OpenJDK GHA Sanity Checks'
2828on :
2929 push :
3030 branches-ignore :
31- - master
3231 - pr/*
33- - jdk*
3432 workflow_dispatch :
3533 inputs :
3634 platforms :
4341 make-arguments :
4442 description : ' Additional make arguments'
4543 required : false
44+ dry-run :
45+ description : ' Dry run: skip actual builds and tests'
46+ required : false
4647
4748concurrency :
4849 group : ${{ github.workflow }}-${{ github.ref }}
7071 windows-x64 : ${{ steps.include.outputs.windows-x64 }}
7172 windows-aarch64 : ${{ steps.include.outputs.windows-aarch64 }}
7273 docs : ${{ steps.include.outputs.docs }}
74+ dry-run : ${{ steps.include.outputs.dry-run }}
7375
7476 steps :
7577 - name : ' Checkout the scripts'
@@ -143,6 +145,35 @@ jobs:
143145 echo 'false'
144146 }
145147
148+ function check_dry_run() {
149+ if [[ $GITHUB_EVENT_NAME == workflow_dispatch ]]; then
150+ # Take the user-specified one.
151+ echo '${{ github.event.inputs.dry-run }}'
152+ return
153+ elif [[ $GITHUB_EVENT_NAME == push ]]; then
154+ # Cut out the real branch name
155+ BRANCH=${GITHUB_REF##*/}
156+
157+ # Dry run rebuilds the caches in current branch, so they can be reused
158+ # for any child PR branches. Because of this, we want to trigger this
159+ # workflow in master branch, so that actual PR branches can use the cache.
160+ # This workflow would trigger every time contributors sync their master
161+ # branches in their personal forks.
162+ if [[ $BRANCH == "master" ]]; then
163+ echo 'true'
164+ return
165+ fi
166+
167+ # ...same for stabilization branches
168+ if [[ $BRANCH =~ "jdk(.*)" ]]; then
169+ echo 'true'
170+ return
171+ fi
172+ fi
173+
174+ echo 'false'
175+ }
176+
146177 echo "linux-x64=$(check_platform linux-x64 linux x64)" >> $GITHUB_OUTPUT
147178 echo "linux-x64-variants=$(check_platform linux-x64-variants variants)" >> $GITHUB_OUTPUT
148179 echo "linux-cross-compile=$(check_platform linux-cross-compile cross-compile)" >> $GITHUB_OUTPUT
@@ -152,6 +183,7 @@ jobs:
152183 echo "windows-x64=$(check_platform windows-x64 windows x64)" >> $GITHUB_OUTPUT
153184 echo "windows-aarch64=$(check_platform windows-aarch64 windows aarch64)" >> $GITHUB_OUTPUT
154185 echo "docs=$(check_platform docs)" >> $GITHUB_OUTPUT
186+ echo "dry-run=$(check_dry_run)" >> $GITHUB_OUTPUT
155187
156188 # ##
157189 # ## Build jobs
@@ -166,6 +198,7 @@ jobs:
166198 gcc-major-version : ' 10'
167199 configure-arguments : ${{ github.event.inputs.configure-arguments }}
168200 make-arguments : ${{ github.event.inputs.make-arguments }}
201+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
169202 if : needs.prepare.outputs.linux-x64 == 'true'
170203
171204 build-linux-x64-hs-nopch :
@@ -180,6 +213,7 @@ jobs:
180213 extra-conf-options : ' --disable-precompiled-headers'
181214 configure-arguments : ${{ github.event.inputs.configure-arguments }}
182215 make-arguments : ${{ github.event.inputs.make-arguments }}
216+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
183217 if : needs.prepare.outputs.linux-x64-variants == 'true'
184218
185219 build-linux-x64-hs-zero :
@@ -194,6 +228,7 @@ jobs:
194228 extra-conf-options : ' --with-jvm-variants=zero --disable-precompiled-headers'
195229 configure-arguments : ${{ github.event.inputs.configure-arguments }}
196230 make-arguments : ${{ github.event.inputs.make-arguments }}
231+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
197232 if : needs.prepare.outputs.linux-x64-variants == 'true'
198233
199234 build-linux-x64-hs-minimal :
@@ -208,6 +243,7 @@ jobs:
208243 extra-conf-options : ' --with-jvm-variants=minimal --disable-precompiled-headers'
209244 configure-arguments : ${{ github.event.inputs.configure-arguments }}
210245 make-arguments : ${{ github.event.inputs.make-arguments }}
246+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
211247 if : needs.prepare.outputs.linux-x64-variants == 'true'
212248
213249 build-linux-x64-hs-optimized :
@@ -223,6 +259,7 @@ jobs:
223259 extra-conf-options : ' --with-debug-level=optimized --disable-precompiled-headers'
224260 configure-arguments : ${{ github.event.inputs.configure-arguments }}
225261 make-arguments : ${{ github.event.inputs.make-arguments }}
262+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
226263 if : needs.prepare.outputs.linux-x64-variants == 'true'
227264
228265 build-linux-x64-static :
@@ -238,6 +275,7 @@ jobs:
238275 gcc-major-version : ' 10'
239276 configure-arguments : ${{ github.event.inputs.configure-arguments }}
240277 make-arguments : ${{ github.event.inputs.make-arguments }}
278+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
241279 static-suffix : " -static"
242280 if : needs.prepare.outputs.linux-x64 == 'true'
243281
@@ -254,6 +292,7 @@ jobs:
254292 gcc-major-version : ' 10'
255293 configure-arguments : ${{ github.event.inputs.configure-arguments }}
256294 make-arguments : ${{ github.event.inputs.make-arguments }}
295+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
257296 # Upload static libs bundles separately to avoid interference with normal linux-x64 bundle.
258297 # This bundle is not used by testing jobs, but downstreams use it to check that
259298 # dependent projects, e.g. libgraal, builds fine.
@@ -268,6 +307,7 @@ jobs:
268307 gcc-major-version : ' 10'
269308 configure-arguments : ${{ github.event.inputs.configure-arguments }}
270309 make-arguments : ${{ github.event.inputs.make-arguments }}
310+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
271311 if : needs.prepare.outputs.linux-cross-compile == 'true'
272312
273313 build-alpine-linux-x64 :
@@ -278,6 +318,7 @@ jobs:
278318 platform : alpine-linux-x64
279319 configure-arguments : ${{ github.event.inputs.configure-arguments }}
280320 make-arguments : ${{ github.event.inputs.make-arguments }}
321+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
281322 if : needs.prepare.outputs.alpine-linux-x64 == 'true'
282323
283324 build-macos-x64 :
@@ -290,6 +331,7 @@ jobs:
290331 xcode-toolset-version : ' 14.3.1'
291332 configure-arguments : ${{ github.event.inputs.configure-arguments }}
292333 make-arguments : ${{ github.event.inputs.make-arguments }}
334+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
293335 if : needs.prepare.outputs.macos-x64 == 'true'
294336
295337 build-macos-aarch64 :
@@ -302,6 +344,7 @@ jobs:
302344 xcode-toolset-version : ' 15.4'
303345 configure-arguments : ${{ github.event.inputs.configure-arguments }}
304346 make-arguments : ${{ github.event.inputs.make-arguments }}
347+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
305348 if : needs.prepare.outputs.macos-aarch64 == 'true'
306349
307350 build-windows-x64 :
@@ -314,6 +357,7 @@ jobs:
314357 msvc-toolset-architecture : ' x86.x64'
315358 configure-arguments : ${{ github.event.inputs.configure-arguments }}
316359 make-arguments : ${{ github.event.inputs.make-arguments }}
360+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
317361 if : needs.prepare.outputs.windows-x64 == 'true'
318362
319363 build-windows-aarch64 :
@@ -328,6 +372,7 @@ jobs:
328372 extra-conf-options : ' --openjdk-target=aarch64-unknown-cygwin'
329373 configure-arguments : ${{ github.event.inputs.configure-arguments }}
330374 make-arguments : ${{ github.event.inputs.make-arguments }}
375+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
331376 if : needs.prepare.outputs.windows-aarch64 == 'true'
332377
333378 build-docs :
@@ -344,6 +389,7 @@ jobs:
344389 gcc-major-version : ' 10'
345390 configure-arguments : ${{ github.event.inputs.configure-arguments }}
346391 make-arguments : ${{ github.event.inputs.make-arguments }}
392+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
347393 if : needs.prepare.outputs.docs == 'true'
348394
349395 # ##
@@ -353,45 +399,53 @@ jobs:
353399 test-linux-x64 :
354400 name : linux-x64
355401 needs :
402+ - prepare
356403 - build-linux-x64
357404 uses : ./.github/workflows/test.yml
358405 with :
359406 platform : linux-x64
360407 bootjdk-platform : linux-x64
361408 runs-on : ubuntu-22.04
409+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
362410 debug-suffix : -debug
363411
364412 test-linux-x64-static :
365413 name : linux-x64-static
366414 needs :
415+ - prepare
367416 - build-linux-x64
368417 - build-linux-x64-static
369418 uses : ./.github/workflows/test.yml
370419 with :
371420 platform : linux-x64
372421 bootjdk-platform : linux-x64
373422 runs-on : ubuntu-22.04
423+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
374424 static-suffix : " -static"
375425
376426 test-macos-aarch64 :
377427 name : macos-aarch64
378428 needs :
429+ - prepare
379430 - build-macos-aarch64
380431 uses : ./.github/workflows/test.yml
381432 with :
382433 platform : macos-aarch64
383434 bootjdk-platform : macos-aarch64
384435 runs-on : macos-14
436+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
385437 xcode-toolset-version : ' 15.4'
386438 debug-suffix : -debug
387439
388440 test-windows-x64 :
389441 name : windows-x64
390442 needs :
443+ - prepare
391444 - build-windows-x64
392445 uses : ./.github/workflows/test.yml
393446 with :
394447 platform : windows-x64
395448 bootjdk-platform : windows-x64
396449 runs-on : windows-2025
450+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
397451 debug-suffix : -debug
0 commit comments