@@ -29,8 +29,7 @@ name: 'SapMachine GHA Sanity Checks'
2929on :
3030 push :
3131 branches-ignore :
32- # SapMachine 2020-11-04: Ignore sapmachine branch
33- - sapmachine
32+ - pr/*
3433 # SapMachine 2020-11-04: Trigger on pull request
3534 pull_request :
3635 branches :
4746 make-arguments :
4847 description : ' Additional make arguments'
4948 required : false
49+ dry-run :
50+ description : ' Dry run: skip actual builds and tests'
51+ required : false
5052
5153concurrency :
5254 group : ${{ github.workflow }}-${{ github.ref }}
7678 windows-x64 : ${{ steps.include.outputs.windows-x64 }}
7779 windows-aarch64 : ${{ steps.include.outputs.windows-aarch64 }}
7880 docs : ${{ steps.include.outputs.docs }}
81+ dry-run : ${{ steps.include.outputs.dry-run }}
7982
8083 steps :
8184 - name : ' Checkout the scripts'
@@ -150,6 +153,47 @@ jobs:
150153 echo 'false'
151154 }
152155
156+ function check_dry_run() {
157+ if [[ $GITHUB_EVENT_NAME == workflow_dispatch ]]; then
158+ # Take the user-specified one.
159+ echo '${{ github.event.inputs.dry-run }}'
160+ return
161+ elif [[ $GITHUB_EVENT_NAME == push ]]; then
162+ # Cut out the real branch name
163+ BRANCH=${GITHUB_REF##*/}
164+
165+ # Dry run rebuilds the caches in current branch, so they can be reused
166+ # for any child PR branches. Because of this, we want to trigger this
167+ # workflow in master branch, so that actual PR branches can use the cache.
168+ # This workflow would trigger every time contributors sync their master
169+ # branches in their personal forks.
170+ if [[ $BRANCH == "master" ]]; then
171+ echo 'true'
172+ return
173+ fi
174+
175+ # SapMachine 2025-07-14: Add sapmachine branch
176+ if [[ $BRANCH == "sapmachine" ]]; then
177+ echo 'true'
178+ return
179+ fi
180+
181+ # ...same for stabilization branches
182+ if [[ $BRANCH =~ "jdk(.*)" ]]; then
183+ echo 'true'
184+ return
185+ fi
186+
187+ # SapMachine 2025-07-14: Add sapmachine* branches
188+ if [[ $BRANCH =~ "sapmachine([0-9]+)" ]]; then
189+ echo 'true'
190+ return
191+ fi
192+ fi
193+
194+ echo 'false'
195+ }
196+
153197 echo "linux-x64=$(check_platform linux-x64 linux x64)" >> $GITHUB_OUTPUT
154198 echo "linux-x64-variants=$(check_platform linux-x64-variants variants)" >> $GITHUB_OUTPUT
155199 echo "linux-cross-compile=$(check_platform linux-cross-compile cross-compile)" >> $GITHUB_OUTPUT
@@ -159,6 +203,7 @@ jobs:
159203 echo "windows-x64=$(check_platform windows-x64 windows x64)" >> $GITHUB_OUTPUT
160204 echo "windows-aarch64=$(check_platform windows-aarch64 windows aarch64)" >> $GITHUB_OUTPUT
161205 echo "docs=$(check_platform docs)" >> $GITHUB_OUTPUT
206+ echo "dry-run=$(check_dry_run)" >> $GITHUB_OUTPUT
162207
163208 # ##
164209 # ## Build jobs
@@ -173,6 +218,7 @@ jobs:
173218 gcc-major-version : ' 10'
174219 configure-arguments : ${{ github.event.inputs.configure-arguments }}
175220 make-arguments : ${{ github.event.inputs.make-arguments }}
221+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
176222 if : needs.prepare.outputs.linux-x64 == 'true'
177223
178224 build-linux-x64-hs-nopch :
@@ -187,6 +233,7 @@ jobs:
187233 extra-conf-options : ' --disable-precompiled-headers'
188234 configure-arguments : ${{ github.event.inputs.configure-arguments }}
189235 make-arguments : ${{ github.event.inputs.make-arguments }}
236+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
190237 if : needs.prepare.outputs.linux-x64-variants == 'true'
191238
192239 build-linux-x64-hs-zero :
@@ -201,6 +248,7 @@ jobs:
201248 extra-conf-options : ' --with-jvm-variants=zero --disable-precompiled-headers'
202249 configure-arguments : ${{ github.event.inputs.configure-arguments }}
203250 make-arguments : ${{ github.event.inputs.make-arguments }}
251+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
204252 if : needs.prepare.outputs.linux-x64-variants == 'true'
205253
206254 build-linux-x64-hs-minimal :
@@ -215,6 +263,7 @@ jobs:
215263 extra-conf-options : ' --with-jvm-variants=minimal --disable-precompiled-headers'
216264 configure-arguments : ${{ github.event.inputs.configure-arguments }}
217265 make-arguments : ${{ github.event.inputs.make-arguments }}
266+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
218267 if : needs.prepare.outputs.linux-x64-variants == 'true'
219268
220269 build-linux-x64-hs-optimized :
@@ -230,6 +279,7 @@ jobs:
230279 extra-conf-options : ' --with-debug-level=optimized --disable-precompiled-headers'
231280 configure-arguments : ${{ github.event.inputs.configure-arguments }}
232281 make-arguments : ${{ github.event.inputs.make-arguments }}
282+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
233283 if : needs.prepare.outputs.linux-x64-variants == 'true'
234284
235285 build-linux-x64-static :
@@ -245,6 +295,7 @@ jobs:
245295 gcc-major-version : ' 10'
246296 configure-arguments : ${{ github.event.inputs.configure-arguments }}
247297 make-arguments : ${{ github.event.inputs.make-arguments }}
298+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
248299 static-suffix : " -static"
249300 if : needs.prepare.outputs.linux-x64 == 'true'
250301
@@ -261,6 +312,7 @@ jobs:
261312 gcc-major-version : ' 10'
262313 configure-arguments : ${{ github.event.inputs.configure-arguments }}
263314 make-arguments : ${{ github.event.inputs.make-arguments }}
315+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
264316 # Upload static libs bundles separately to avoid interference with normal linux-x64 bundle.
265317 # This bundle is not used by testing jobs, but downstreams use it to check that
266318 # dependent projects, e.g. libgraal, builds fine.
@@ -275,6 +327,7 @@ jobs:
275327 gcc-major-version : ' 10'
276328 configure-arguments : ${{ github.event.inputs.configure-arguments }}
277329 make-arguments : ${{ github.event.inputs.make-arguments }}
330+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
278331 if : needs.prepare.outputs.linux-cross-compile == 'true'
279332
280333 build-alpine-linux-x64 :
@@ -285,6 +338,7 @@ jobs:
285338 platform : alpine-linux-x64
286339 configure-arguments : ${{ github.event.inputs.configure-arguments }}
287340 make-arguments : ${{ github.event.inputs.make-arguments }}
341+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
288342 if : needs.prepare.outputs.alpine-linux-x64 == 'true'
289343
290344 build-macos-x64 :
@@ -297,6 +351,7 @@ jobs:
297351 xcode-toolset-version : ' 14.3.1'
298352 configure-arguments : ${{ github.event.inputs.configure-arguments }}
299353 make-arguments : ${{ github.event.inputs.make-arguments }}
354+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
300355 if : needs.prepare.outputs.macos-x64 == 'true'
301356
302357 build-macos-aarch64 :
@@ -309,6 +364,7 @@ jobs:
309364 xcode-toolset-version : ' 15.4'
310365 configure-arguments : ${{ github.event.inputs.configure-arguments }}
311366 make-arguments : ${{ github.event.inputs.make-arguments }}
367+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
312368 if : needs.prepare.outputs.macos-aarch64 == 'true'
313369
314370 build-windows-x64 :
@@ -321,6 +377,7 @@ jobs:
321377 msvc-toolset-architecture : ' x86.x64'
322378 configure-arguments : ${{ github.event.inputs.configure-arguments }}
323379 make-arguments : ${{ github.event.inputs.make-arguments }}
380+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
324381 if : needs.prepare.outputs.windows-x64 == 'true'
325382
326383 build-windows-aarch64 :
@@ -335,6 +392,7 @@ jobs:
335392 extra-conf-options : ' --openjdk-target=aarch64-unknown-cygwin'
336393 configure-arguments : ${{ github.event.inputs.configure-arguments }}
337394 make-arguments : ${{ github.event.inputs.make-arguments }}
395+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
338396 if : needs.prepare.outputs.windows-aarch64 == 'true'
339397
340398 build-docs :
@@ -351,6 +409,7 @@ jobs:
351409 gcc-major-version : ' 10'
352410 configure-arguments : ${{ github.event.inputs.configure-arguments }}
353411 make-arguments : ${{ github.event.inputs.make-arguments }}
412+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
354413 if : needs.prepare.outputs.docs == 'true'
355414
356415 # ##
@@ -360,45 +419,53 @@ jobs:
360419 test-linux-x64 :
361420 name : linux-x64
362421 needs :
422+ - prepare
363423 - build-linux-x64
364424 uses : ./.github/workflows/test.yml
365425 with :
366426 platform : linux-x64
367427 bootjdk-platform : linux-x64
368428 runs-on : ubuntu-22.04
429+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
369430 debug-suffix : -debug
370431
371432 test-linux-x64-static :
372433 name : linux-x64-static
373434 needs :
435+ - prepare
374436 - build-linux-x64
375437 - build-linux-x64-static
376438 uses : ./.github/workflows/test.yml
377439 with :
378440 platform : linux-x64
379441 bootjdk-platform : linux-x64
380442 runs-on : ubuntu-22.04
443+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
381444 static-suffix : " -static"
382445
383446 test-macos-aarch64 :
384447 name : macos-aarch64
385448 needs :
449+ - prepare
386450 - build-macos-aarch64
387451 uses : ./.github/workflows/test.yml
388452 with :
389453 platform : macos-aarch64
390454 bootjdk-platform : macos-aarch64
391455 runs-on : macos-14
456+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
392457 xcode-toolset-version : ' 15.4'
393458 debug-suffix : -debug
394459
395460 test-windows-x64 :
396461 name : windows-x64
397462 needs :
463+ - prepare
398464 - build-windows-x64
399465 uses : ./.github/workflows/test.yml
400466 with :
401467 platform : windows-x64
402468 bootjdk-platform : windows-x64
403469 runs-on : windows-2025
470+ dry-run : ${{ needs.prepare.outputs.dry-run == 'true' }}
404471 debug-suffix : -debug
0 commit comments