From 6d960b9c3c73385d035bb88744ea33bee1cf2e93 Mon Sep 17 00:00:00 2001 From: Seth Flynn Date: Thu, 12 Jun 2025 20:10:51 -0400 Subject: [PATCH] ci(setup-deps): always use sccache, simplify restore key sccache is available on arm runners. we can use the restore key for an easy, unique restore key in the cache too (it also prevents us from re-using the ccache caches!) Signed-off-by: Seth Flynn --- .github/actions/setup-dependencies/action.yml | 11 +++++++---- .github/workflows/build.yml | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/actions/setup-dependencies/action.yml b/.github/actions/setup-dependencies/action.yml index e97abd1df..47a9819ea 100644 --- a/.github/actions/setup-dependencies/action.yml +++ b/.github/actions/setup-dependencies/action.yml @@ -6,6 +6,9 @@ inputs: description: Type for the build required: true default: Debug + artifact-name: + description: Name of the uploaded artifact + required: true msystem: description: MSYS2 subsystem to use required: false @@ -53,16 +56,16 @@ runs: if: ${{ (runner.os != 'Windows' || inputs.msystem == '') && inputs.build-type == 'Debug' }} uses: hendrikmuhs/ccache-action@v1.2.18 with: - variant: ${{ runner.os == 'Windows' && 'sccache' || 'ccache' }} + variant: sccache create-symlink: ${{ runner.os != 'Windows' }} - key: ${{ runner.os }}-qt${{ inputs.qt_ver }}-${{ inputs.architecture }} + key: ${{ runner.os }}-${{ runner.arch }}-${{ inputs.artifact-name }}-sccache - name: Use ccache on debug builds if: ${{ inputs.build-type == 'Debug' }} shell: bash env: - # Only use sccache on MSVC - CCACHE_VARIANT: ${{ (runner.os == 'Windows' && inputs.msystem == '') && 'sccache' || 'ccache' }} + # Only use ccache on MSYS2 + CCACHE_VARIANT: ${{ (runner.os == 'Windows' && inputs.msystem != '') && 'ccache' || 'sccache' }} run: | echo "CMAKE_C_COMPILER_LAUNCHER=$CCACHE_VARIANT" >> "$GITHUB_ENV" echo "CMAKE_CXX_COMPILER_LAUNCHER=$CCACHE_VARIANT" >> "$GITHUB_ENV" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 602efbeae..7df86c3ec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -126,6 +126,7 @@ jobs: uses: ./.github/actions/setup-dependencies with: build-type: ${{ inputs.build-type || 'Debug' }} + artifact-name: ${{ matrix.artifact-name }} msystem: ${{ matrix.msystem }} vcvars-arch: ${{ matrix.vcvars-arch }} qt-architecture: ${{ matrix.qt-architecture }}