diff --git a/.github/workflows/build-alpine-linux.yml b/.github/workflows/build-alpine-linux.yml index ac5870ca675..0d366a4bdd0 100644 --- a/.github/workflows/build-alpine-linux.yml +++ b/.github/workflows/build-alpine-linux.yml @@ -51,6 +51,10 @@ on: make-arguments: required: false type: string + dry-run: + required: false + type: boolean + default: false jobs: build-linux: @@ -104,9 +108,11 @@ jobs: make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}' platform: ${{ inputs.platform }} debug-suffix: '${{ matrix.suffix }}' + if: ${{ inputs.dry-run == false }} - name: 'Upload bundles' uses: ./.github/actions/upload-bundles with: platform: ${{ inputs.platform }} debug-suffix: '${{ matrix.suffix }}' + if: ${{ inputs.dry-run == false }} diff --git a/.github/workflows/build-cross-compile.yml b/.github/workflows/build-cross-compile.yml index 3f4ba67f996..5aadaab05c9 100644 --- a/.github/workflows/build-cross-compile.yml +++ b/.github/workflows/build-cross-compile.yml @@ -40,6 +40,10 @@ on: make-arguments: required: false type: string + dry-run: + required: false + type: boolean + default: false jobs: build-cross-compile: @@ -189,4 +193,4 @@ jobs: with: make-target: 'hotspot ${{ inputs.make-arguments }}' platform: linux-${{ matrix.target-cpu }} - if: steps.create-sysroot.outcome == 'success' || steps.get-cached-sysroot.outputs.cache-hit == 'true' + if: ((steps.create-sysroot.outcome == 'success' || steps.get-cached-sysroot.outputs.cache-hit == 'true') && inputs.dry-run == false) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 9c991eed419..f398625cb2c 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -61,6 +61,10 @@ on: make-arguments: required: false type: string + dry-run: + required: false + type: boolean + default: false bundle-suffix: required: false type: string @@ -139,6 +143,7 @@ jobs: make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}' platform: ${{ inputs.platform }} debug-suffix: "${{ matrix.debug-level == 'debug' && '-debug' || '' }}" + if: ${{ inputs.dry-run == false }} - name: 'Upload bundles' uses: ./.github/actions/upload-bundles @@ -147,3 +152,4 @@ jobs: debug-suffix: "${{ matrix.debug-level == 'debug' && '-debug' || '' }}" bundle-suffix: ${{ inputs.bundle-suffix }} static-suffix: ${{ inputs.static-suffix }} + if: ${{ inputs.dry-run == false }} diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 90bb6af044f..0a12df668e5 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -54,6 +54,10 @@ on: make-arguments: required: false type: string + dry-run: + required: false + type: boolean + default: false jobs: build-macos: @@ -118,9 +122,11 @@ jobs: make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}' platform: ${{ inputs.platform }} debug-suffix: '${{ matrix.suffix }}' + if: ${{ inputs.dry-run == false }} - name: 'Upload bundles' uses: ./.github/actions/upload-bundles with: platform: ${{ inputs.platform }} debug-suffix: '${{ matrix.suffix }}' + if: ${{ inputs.dry-run == false }} diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 9bb43a8b83c..a3091b94cef 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -54,6 +54,10 @@ on: make-arguments: required: false type: string + dry-run: + required: false + type: boolean + default: false env: # These are needed to make the MSYS2 bash work properly @@ -139,6 +143,7 @@ jobs: # Set PATH to "", so just GITHUB_PATH is included PATH: '' shell: env /usr/bin/bash --login -eo pipefail {0} + if: ${{ inputs.dry-run == false }} - name: 'Build' id: build @@ -147,9 +152,11 @@ jobs: make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}' platform: ${{ inputs.platform }} debug-suffix: '${{ matrix.suffix }}' + if: ${{ inputs.dry-run == false }} - name: 'Upload bundles' uses: ./.github/actions/upload-bundles with: platform: ${{ inputs.platform }} debug-suffix: '${{ matrix.suffix }}' + if: ${{ inputs.dry-run == false }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8c058440ad7..0d8663fab1a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,9 +28,7 @@ name: 'OpenJDK GHA Sanity Checks' on: push: branches-ignore: - - master - pr/* - - jdk* workflow_dispatch: inputs: platforms: @@ -43,6 +41,9 @@ on: make-arguments: description: 'Additional make arguments' required: false + dry-run: + description: 'Dry run: skip actual builds and tests' + required: false concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -70,6 +71,7 @@ jobs: windows-x64: ${{ steps.include.outputs.windows-x64 }} windows-aarch64: ${{ steps.include.outputs.windows-aarch64 }} docs: ${{ steps.include.outputs.docs }} + dry-run: ${{ steps.include.outputs.dry-run }} steps: - name: 'Checkout the scripts' @@ -143,6 +145,35 @@ jobs: echo 'false' } + function check_dry_run() { + if [[ $GITHUB_EVENT_NAME == workflow_dispatch ]]; then + # Take the user-specified one. + echo '${{ github.event.inputs.dry-run }}' + return + elif [[ $GITHUB_EVENT_NAME == push ]]; then + # Cut out the real branch name + BRANCH=${GITHUB_REF##*/} + + # Dry run rebuilds the caches in current branch, so they can be reused + # for any child PR branches. Because of this, we want to trigger this + # workflow in master branch, so that actual PR branches can use the cache. + # This workflow would trigger every time contributors sync their master + # branches in their personal forks. + if [[ $BRANCH == "master" ]]; then + echo 'true' + return + fi + + # ...same for stabilization branches + if [[ $BRANCH =~ "jdk(.*)" ]]; then + echo 'true' + return + fi + fi + + echo 'false' + } + echo "linux-x64=$(check_platform linux-x64 linux x64)" >> $GITHUB_OUTPUT echo "linux-x64-variants=$(check_platform linux-x64-variants variants)" >> $GITHUB_OUTPUT echo "linux-cross-compile=$(check_platform linux-cross-compile cross-compile)" >> $GITHUB_OUTPUT @@ -152,6 +183,7 @@ jobs: echo "windows-x64=$(check_platform windows-x64 windows x64)" >> $GITHUB_OUTPUT echo "windows-aarch64=$(check_platform windows-aarch64 windows aarch64)" >> $GITHUB_OUTPUT echo "docs=$(check_platform docs)" >> $GITHUB_OUTPUT + echo "dry-run=$(check_dry_run)" >> $GITHUB_OUTPUT ### ### Build jobs @@ -166,6 +198,7 @@ jobs: gcc-major-version: '10' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} + dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }} if: needs.prepare.outputs.linux-x64 == 'true' build-linux-x64-hs-nopch: @@ -180,6 +213,7 @@ jobs: extra-conf-options: '--disable-precompiled-headers' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} + dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }} if: needs.prepare.outputs.linux-x64-variants == 'true' build-linux-x64-hs-zero: @@ -194,6 +228,7 @@ jobs: extra-conf-options: '--with-jvm-variants=zero --disable-precompiled-headers' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} + dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }} if: needs.prepare.outputs.linux-x64-variants == 'true' build-linux-x64-hs-minimal: @@ -208,6 +243,7 @@ jobs: extra-conf-options: '--with-jvm-variants=minimal --disable-precompiled-headers' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} + dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }} if: needs.prepare.outputs.linux-x64-variants == 'true' build-linux-x64-hs-optimized: @@ -223,6 +259,7 @@ jobs: extra-conf-options: '--with-debug-level=optimized --disable-precompiled-headers' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} + dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }} if: needs.prepare.outputs.linux-x64-variants == 'true' build-linux-x64-static: @@ -238,6 +275,7 @@ jobs: gcc-major-version: '10' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} + dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }} static-suffix: "-static" if: needs.prepare.outputs.linux-x64 == 'true' @@ -254,6 +292,7 @@ jobs: gcc-major-version: '10' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} + dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }} # Upload static libs bundles separately to avoid interference with normal linux-x64 bundle. # This bundle is not used by testing jobs, but downstreams use it to check that # dependent projects, e.g. libgraal, builds fine. @@ -268,6 +307,7 @@ jobs: gcc-major-version: '10' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} + dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }} if: needs.prepare.outputs.linux-cross-compile == 'true' build-alpine-linux-x64: @@ -278,6 +318,7 @@ jobs: platform: alpine-linux-x64 configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} + dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }} if: needs.prepare.outputs.alpine-linux-x64 == 'true' build-macos-x64: @@ -290,6 +331,7 @@ jobs: xcode-toolset-version: '14.3.1' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} + dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }} if: needs.prepare.outputs.macos-x64 == 'true' build-macos-aarch64: @@ -302,6 +344,7 @@ jobs: xcode-toolset-version: '15.4' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} + dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }} if: needs.prepare.outputs.macos-aarch64 == 'true' build-windows-x64: @@ -314,6 +357,7 @@ jobs: msvc-toolset-architecture: 'x86.x64' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} + dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }} if: needs.prepare.outputs.windows-x64 == 'true' build-windows-aarch64: @@ -328,6 +372,7 @@ jobs: extra-conf-options: '--openjdk-target=aarch64-unknown-cygwin' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} + dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }} if: needs.prepare.outputs.windows-aarch64 == 'true' build-docs: @@ -344,6 +389,7 @@ jobs: gcc-major-version: '10' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} + dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }} if: needs.prepare.outputs.docs == 'true' ### @@ -353,17 +399,20 @@ jobs: test-linux-x64: name: linux-x64 needs: + - prepare - build-linux-x64 uses: ./.github/workflows/test.yml with: platform: linux-x64 bootjdk-platform: linux-x64 runs-on: ubuntu-22.04 + dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }} debug-suffix: -debug test-linux-x64-static: name: linux-x64-static needs: + - prepare - build-linux-x64 - build-linux-x64-static uses: ./.github/workflows/test.yml @@ -371,27 +420,32 @@ jobs: platform: linux-x64 bootjdk-platform: linux-x64 runs-on: ubuntu-22.04 + dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }} static-suffix: "-static" test-macos-aarch64: name: macos-aarch64 needs: + - prepare - build-macos-aarch64 uses: ./.github/workflows/test.yml with: platform: macos-aarch64 bootjdk-platform: macos-aarch64 runs-on: macos-14 + dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }} xcode-toolset-version: '15.4' debug-suffix: -debug test-windows-x64: name: windows-x64 needs: + - prepare - build-windows-x64 uses: ./.github/workflows/test.yml with: platform: windows-x64 bootjdk-platform: windows-x64 runs-on: windows-2025 + dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }} debug-suffix: -debug diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 665ae224372..f2c8916a369 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,6 +40,10 @@ on: xcode-toolset-version: required: false type: string + dry-run: + required: false + type: boolean + default: false debug-suffix: required: false type: string @@ -147,6 +151,7 @@ jobs: platform: ${{ inputs.platform }} debug-suffix: ${{ matrix.debug-suffix }} static-suffix: ${{ inputs.static-suffix }} + if: ${{ inputs.dry-run == false }} - name: 'Install dependencies' run: | @@ -199,6 +204,7 @@ jobs: && bash ./.github/scripts/gen-test-summary.sh "$GITHUB_STEP_SUMMARY" "$GITHUB_OUTPUT" env: PATH: ${{ steps.path.outputs.value }} + if: ${{ inputs.dry-run == false }} # This is a separate step, since if the markdown from a step gets bigger than # 1024 kB it is skipped, but then the short summary above is still generated