From dfc9119bbcb1d590bf5787177ee246f536d0dbcb Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Tue, 1 Apr 2025 19:34:31 +0200 Subject: [PATCH] feat: add 'use-sccache' input to build workflows for improved caching options --- .github/workflows/build.yml | 9 +++++++++ .github/workflows/linux-release-build.yml | 10 ++++++++-- .github/workflows/macos-release-build.yml | 10 ++++++++-- .github/workflows/twilight-release-schedule.yml | 6 ++++++ .github/workflows/windows-release-build.yml | 10 ++++++++-- 5 files changed, 39 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a3c8132ea..4bf1aed95 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,6 +38,11 @@ on: required: true default: 'release' type: 'string' + use-sccache: + description: 'Use sccache' + required: true + type: 'boolean' + default: false jobs: debug-inputs: @@ -282,6 +287,7 @@ jobs: contents: write secrets: inherit with: + use-sccache: ${{ inputs.use-sccache }} build-version: ${{ needs.build-data.outputs.version }} generate-gpo: true profile-data-path-archive: zen-windows-profile-data-and-jarlog.zip @@ -312,6 +318,7 @@ jobs: generate-gpo: false release-branch: ${{ inputs.update_branch }} MOZ_BUILD_DATE: ${{needs.buildid.outputs.buildids}} + use-sccache: ${{ inputs.use-sccache }} linux: name: Linux build @@ -324,6 +331,7 @@ jobs: build-version: ${{ needs.build-data.outputs.version }} release-branch: ${{ inputs.update_branch }} MOZ_BUILD_DATE: ${{needs.buildid.outputs.buildids}} + use-sccache: ${{ inputs.use-sccache }} mac: name: macOS build @@ -336,6 +344,7 @@ jobs: build-version: ${{ needs.build-data.outputs.version }} release-branch: ${{ inputs.update_branch }} MOZ_BUILD_DATE: ${{needs.buildid.outputs.buildids}} + use-sccache: ${{ inputs.use-sccache }} mac-uni: name: macOS build (Universal) diff --git a/.github/workflows/linux-release-build.yml b/.github/workflows/linux-release-build.yml index a56a81d7d..008b59ae3 100644 --- a/.github/workflows/linux-release-build.yml +++ b/.github/workflows/linux-release-build.yml @@ -15,6 +15,11 @@ on: type: string required: true default: '' + use-sccache: + description: 'Use sccache' + required: true + type: boolean + default: false jobs: build-linux: @@ -27,9 +32,9 @@ jobs: matrix: arch: [x86_64, aarch64] env: - SCCACHE_GHA_ENABLED: 'true' + SCCACHE_GHA_ENABLED: ${ inputs.use-sccache } CARGO_TERM_COLOR: always - RUSTC_WRAPPER: 'sccache' + RUSTC_WRAPPER: ${ inputs.use-sccache && 'sccache' || '' } CARGO_INCREMENTAL: 0 name: Build Linux - ${{ matrix.arch }} @@ -56,6 +61,7 @@ jobs: - name: Run sccache-cache uses: mozilla-actions/sccache-action@main + if: ${{ inputs.use-sccache }} with: disable_annotations: true diff --git a/.github/workflows/macos-release-build.yml b/.github/workflows/macos-release-build.yml index 838c9a3e0..1aef80095 100644 --- a/.github/workflows/macos-release-build.yml +++ b/.github/workflows/macos-release-build.yml @@ -15,6 +15,11 @@ on: type: string required: true default: '' + use-sccache: + description: 'Use sccache' + required: true + type: boolean + default: false jobs: mac-build: @@ -26,9 +31,9 @@ jobs: matrix: arch: [x86_64, aarch64] env: - SCCACHE_GHA_ENABLED: 'true' + SCCACHE_GHA_ENABLED: ${ inputs.use-sccache } CARGO_TERM_COLOR: always - RUSTC_WRAPPER: 'sccache' + RUSTC_WRAPPER: ${ inputs.use-sccache && 'sccache' || '' } CARGO_INCREMENTAL: 0 steps: - name: Checkout repository @@ -44,6 +49,7 @@ jobs: - name: Run sccache-cache uses: mozilla-actions/sccache-action@main + if: ${{ inputs.use-sccache }} with: disable_annotations: true diff --git a/.github/workflows/twilight-release-schedule.yml b/.github/workflows/twilight-release-schedule.yml index bf2c3c7d2..c3fb8d8ca 100644 --- a/.github/workflows/twilight-release-schedule.yml +++ b/.github/workflows/twilight-release-schedule.yml @@ -10,6 +10,11 @@ on: required: false type: boolean default: true + use-sccache: + description: 'Use sccache' + required: false + type: boolean + default: true jobs: twilight-release-schedule: @@ -20,6 +25,7 @@ jobs: with: create_release: ${{ github.event_name != 'workflow_dispatch' && true || inputs.create_release }} update_branch: twilight + use-sccache: ${{ github.event_name != 'workflow_dispatch' && false || inputs.use-sccache }} update_version: false post-build: diff --git a/.github/workflows/windows-release-build.yml b/.github/workflows/windows-release-build.yml index e9d95eeec..0a6f39bb9 100644 --- a/.github/workflows/windows-release-build.yml +++ b/.github/workflows/windows-release-build.yml @@ -22,6 +22,11 @@ on: type: string required: true default: '' + use-sccache: + description: 'Use sccache' + required: true + type: boolean + default: false jobs: windows-build: @@ -29,9 +34,9 @@ jobs: # aarch64 does not need full 16x, and we also dont use full LTO when generating GPO runs-on: ${{ (inputs.release-branch == 'release' && !inputs.generate-gpo && matrix.arch == 'x86_64') && 'self-hosted' || 'ubuntu-latest' }} env: - SCCACHE_GHA_ENABLED: 'true' + SCCACHE_GHA_ENABLED: ${ inputs.use-sccache } CARGO_TERM_COLOR: always - RUSTC_WRAPPER: 'sccache' + RUSTC_WRAPPER: ${ inputs.use-sccache && 'sccache' || '' } CARGO_INCREMENTAL: 0 strategy: fail-fast: false @@ -62,6 +67,7 @@ jobs: - name: Run sccache-cache uses: mozilla-actions/sccache-action@main + if: ${{ inputs.use-sccache }} with: disable_annotations: true