From d095a91f64d1af4669932188214c1f5000b1d958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Insaurralde=20Avalos?= Date: Tue, 10 Sep 2024 11:16:29 -0400 Subject: [PATCH] Fix compiler cache for conda linux builds --- .../workflows/actions/linux/generateCacheKey/action.yml | 5 ++++- .github/workflows/sub_buildUbuntu2004.yml | 1 + .github/workflows/sub_buildUbuntu2204Conda.yml | 1 + .github/workflows/sub_buildUbuntu2204CondaQt6.yml | 7 ++++--- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/actions/linux/generateCacheKey/action.yml b/.github/workflows/actions/linux/generateCacheKey/action.yml index 36053fe6c6..f4152073e9 100644 --- a/.github/workflows/actions/linux/generateCacheKey/action.yml +++ b/.github/workflows/actions/linux/generateCacheKey/action.yml @@ -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 diff --git a/.github/workflows/sub_buildUbuntu2004.yml b/.github/workflows/sub_buildUbuntu2004.yml index 6d1e8135e3..c5dfc63046 100644 --- a/.github/workflows/sub_buildUbuntu2004.yml +++ b/.github/workflows/sub_buildUbuntu2004.yml @@ -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: diff --git a/.github/workflows/sub_buildUbuntu2204Conda.yml b/.github/workflows/sub_buildUbuntu2204Conda.yml index 202a39a341..4e47caacad 100644 --- a/.github/workflows/sub_buildUbuntu2204Conda.yml +++ b/.github/workflows/sub_buildUbuntu2204Conda.yml @@ -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: diff --git a/.github/workflows/sub_buildUbuntu2204CondaQt6.yml b/.github/workflows/sub_buildUbuntu2204CondaQt6.yml index 44cb8db3e7..9c4cd26616 100644 --- a/.github/workflows/sub_buildUbuntu2204CondaQt6.yml +++ b/.github/workflows/sub_buildUbuntu2204CondaQt6.yml @@ -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