ci: env.cache_id added to fix caching of Conan data

This commit is contained in:
Mateusz Pusz
2024-01-12 12:55:54 +01:00
parent d05817df3f
commit 363e6995ea
3 changed files with 9 additions and 6 deletions

View File

@@ -129,15 +129,16 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- name: Cache Conan data
uses: actions/cache@v3
env:
cache-name: cache-conan-data
with:
path: ~/.conan2/p
key: build-${{ matrix.config.os }}-${{ matrix.config.compiler.type }}-${{ matrix.config.lib }}-${{ matrix.build_type }}-${{ matrix.config.compiler.version }}-${{ matrix.std }}
key: build-${{ matrix.config.os }}-${{ matrix.config.compiler.type }}-${{ matrix.config.lib }}-${{ matrix.build_type }}-${{ matrix.config.compiler.version }}-${{ matrix.std }}-${{ env.cache_id }}
restore-keys: |
build-${{ matrix.config.os }}-${{ matrix.config.compiler.type }}-${{ matrix.config.lib }}-${{ matrix.build_type }}-${{ matrix.config.compiler.version }}-${{ matrix.std }}
build-${{ matrix.config.os }}-${{ matrix.config.compiler.type }}-${{ matrix.config.lib }}-${{ matrix.build_type }}-${{ matrix.config.compiler.version }}-${{ matrix.std }}-
build-${{ matrix.config.os }}-${{ matrix.config.compiler.type }}-${{ matrix.config.lib }}-${{ matrix.build_type }}-${{ matrix.config.compiler.version }}-
build-${{ matrix.config.os }}-${{ matrix.config.compiler.type }}-${{ matrix.config.lib }}-${{ matrix.build_type }}-
build-${{ matrix.config.os }}-${{ matrix.config.compiler.type }}-${{ matrix.config.lib }}-

View File

@@ -128,15 +128,16 @@ jobs:
with:
string: ${{ matrix.build_type }}
- uses: actions/checkout@v4
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- name: Cache Conan data
uses: actions/cache@v3
env:
cache-name: cache-conan-data
with:
path: ~/.conan2/p
key: build-${{ matrix.config.os }}-${{ matrix.config.compiler.type }}-${{ matrix.config.lib }}-${{ matrix.build_type }}-${{ matrix.config.compiler.version }}-${{ matrix.std }}
key: build-${{ matrix.config.os }}-${{ matrix.config.compiler.type }}-${{ matrix.config.lib }}-${{ matrix.build_type }}-${{ matrix.config.compiler.version }}-${{ matrix.std }}-${{ env.cache_id }}
restore-keys: |
build-${{ matrix.config.os }}-${{ matrix.config.compiler.type }}-${{ matrix.config.lib }}-${{ matrix.build_type }}-${{ matrix.config.compiler.version }}-${{ matrix.std }}
build-${{ matrix.config.os }}-${{ matrix.config.compiler.type }}-${{ matrix.config.lib }}-${{ matrix.build_type }}-${{ matrix.config.compiler.version }}-${{ matrix.std }}-
build-${{ matrix.config.os }}-${{ matrix.config.compiler.type }}-${{ matrix.config.lib }}-${{ matrix.build_type }}-${{ matrix.config.compiler.version }}-
build-${{ matrix.config.os }}-${{ matrix.config.compiler.type }}-${{ matrix.config.lib }}-${{ matrix.build_type }}-
build-${{ matrix.config.os }}-${{ matrix.config.compiler.type }}-${{ matrix.config.lib }}-

View File

@@ -79,6 +79,7 @@ jobs:
# Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- name: Cache Conan data
if: matrix.language == 'cpp'
uses: actions/cache@v3
@@ -86,9 +87,9 @@ jobs:
cache-name: cache-conan-data
with:
path: ~/.conan2/p
key: build-${{ matrix.os }}-$BUILD_TYPE-$COMPILER_TYPE-$COMPILER_VERSION-$STDLIB
key: build-${{ matrix.os }}-$BUILD_TYPE-$COMPILER_TYPE-$COMPILER_VERSION-$STDLIB-${{ env.cache_id }}
restore-keys: |
build-${{ matrix.os }}-$BUILD_TYPE-$COMPILER_TYPE-$COMPILER_VERSION-
build-${{ matrix.os }}-$BUILD_TYPE-$COMPILER_TYPE-$COMPILER_VERSION-$STDLIB-
build-${{ matrix.os }}-$BUILD_TYPE-$COMPILER_TYPE-
build-${{ matrix.os }}-$BUILD_TYPE-
build-${{ matrix.os }}-