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 <getchoo@tuta.io>
This commit is contained in:
Seth Flynn 2025-06-12 20:10:51 -04:00
parent 04ecd447bc
commit 6d960b9c3c
No known key found for this signature in database
GPG Key ID: D31BD0D494BBEE86
2 changed files with 8 additions and 4 deletions

View File

@ -6,6 +6,9 @@ inputs:
description: Type for the build description: Type for the build
required: true required: true
default: Debug default: Debug
artifact-name:
description: Name of the uploaded artifact
required: true
msystem: msystem:
description: MSYS2 subsystem to use description: MSYS2 subsystem to use
required: false required: false
@ -53,16 +56,16 @@ runs:
if: ${{ (runner.os != 'Windows' || inputs.msystem == '') && inputs.build-type == 'Debug' }} if: ${{ (runner.os != 'Windows' || inputs.msystem == '') && inputs.build-type == 'Debug' }}
uses: hendrikmuhs/ccache-action@v1.2.18 uses: hendrikmuhs/ccache-action@v1.2.18
with: with:
variant: ${{ runner.os == 'Windows' && 'sccache' || 'ccache' }} variant: sccache
create-symlink: ${{ runner.os != 'Windows' }} 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 - name: Use ccache on debug builds
if: ${{ inputs.build-type == 'Debug' }} if: ${{ inputs.build-type == 'Debug' }}
shell: bash shell: bash
env: env:
# Only use sccache on MSVC # Only use ccache on MSYS2
CCACHE_VARIANT: ${{ (runner.os == 'Windows' && inputs.msystem == '') && 'sccache' || 'ccache' }} CCACHE_VARIANT: ${{ (runner.os == 'Windows' && inputs.msystem != '') && 'ccache' || 'sccache' }}
run: | run: |
echo "CMAKE_C_COMPILER_LAUNCHER=$CCACHE_VARIANT" >> "$GITHUB_ENV" echo "CMAKE_C_COMPILER_LAUNCHER=$CCACHE_VARIANT" >> "$GITHUB_ENV"
echo "CMAKE_CXX_COMPILER_LAUNCHER=$CCACHE_VARIANT" >> "$GITHUB_ENV" echo "CMAKE_CXX_COMPILER_LAUNCHER=$CCACHE_VARIANT" >> "$GITHUB_ENV"

View File

@ -126,6 +126,7 @@ jobs:
uses: ./.github/actions/setup-dependencies uses: ./.github/actions/setup-dependencies
with: with:
build-type: ${{ inputs.build-type || 'Debug' }} build-type: ${{ inputs.build-type || 'Debug' }}
artifact-name: ${{ matrix.artifact-name }}
msystem: ${{ matrix.msystem }} msystem: ${{ matrix.msystem }}
vcvars-arch: ${{ matrix.vcvars-arch }} vcvars-arch: ${{ matrix.vcvars-arch }}
qt-architecture: ${{ matrix.qt-architecture }} qt-architecture: ${{ matrix.qt-architecture }}