Fix compiler cache for conda linux builds

This commit is contained in:
Adrián Insaurralde Avalos
2024-09-10 11:16:29 -04:00
committed by Adrián Insaurralde Avalos
parent a4313f358e
commit d095a91f64
4 changed files with 10 additions and 4 deletions

View File

@@ -28,6 +28,9 @@ inputs:
compiler:
description: "Binary name/path of compiler to be used"
required: true
qt_major_version:
description: "Major version number of qt to be used"
required: true
outputs:
cacheKey:
description: "Cache key with distro and compiler version"
@@ -39,6 +42,6 @@ runs:
- id: generateCacheKey
shell: bash -l {0}
run: |
cacheKey=$(lsb_release -ds | tr -d ' ')-$(basename ${{ inputs.compiler }})$(${{ inputs.compiler }} -dumpfullversion -dumpversion)
cacheKey=$(lsb_release -ds | tr -d ' ')-$(basename ${{ inputs.compiler }})$(${{ inputs.compiler }} -dumpfullversion -dumpversion)-qt${{ inputs.qt_major_version }}
echo "Generated cache key : $cacheKey"
echo "cacheKey=$cacheKey" >> $GITHUB_OUTPUT

View File

@@ -152,6 +152,7 @@ jobs:
uses: ./.github/workflows/actions/linux/generateCacheKey
with:
compiler: ${{ env.CXX }}
qt_major_version: 5
- name: Restore Compiler Cache
uses: actions/cache@v4
with:

View File

@@ -102,6 +102,7 @@ jobs:
uses: ./.github/workflows/actions/linux/generateCacheKey
with:
compiler: ${{ env.CXX }}
qt_major_version: 5
- name: Restore Compiler Cache
uses: actions/cache@v4
with:

View File

@@ -108,15 +108,16 @@ jobs:
uses: ./.github/workflows/actions/linux/generateCacheKey
with:
compiler: ${{ env.CXX }}
qt_major_version: 6
- name: Restore Compiler Cache
uses: actions/cache@v4
with:
save-always: true
path: ${{ env.CCACHE_DIR }}
key: FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-${{ github.run_id }}-qt6
key: FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-${{ github.run_id }}
restore-keys: |
FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-qt6-
FC-${{ steps.genCacheKey.outputs.cacheKey }}-qt6-
FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-
FC-${{ steps.genCacheKey.outputs.cacheKey }}-
- name: Print CCache statistics before build, reset stats and print config
run: |
ccache -s