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:
11
.github/actions/setup-dependencies/action.yml
vendored
11
.github/actions/setup-dependencies/action.yml
vendored
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user