Skip to content

Commit

Permalink
Create a conan cache and restore it before the install step (#334)
Browse files Browse the repository at this point in the history
* Create a conan cache and restore it before the install step

* Run pre-commit
  • Loading branch information
Twon authored Oct 20, 2024
1 parent 6c8a6a6 commit a4fe91c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
env:
cache-name: cache-conan-data
with:
path: ${{github.workspace}}/.conan2/p
path: ${{github.workspace}}/conan_cache_save.tgz
key: ${{ hashFiles('**/conanfile.py') }}-build-${{ matrix.settings.os }}-${{ matrix.configuration }}-${{ matrix.settings.compiler.conan }}-${{ matrix.settings.compiler.version }}-${{ matrix.settings.lib }}
restore-keys: |
${{ hashFiles('**/conanfile.py') }}-build-${{ matrix.settings.os }}-${{ matrix.configuration }}-${{ matrix.settings.compiler.conan }}-${{ matrix.settings.compiler.version }}-
Expand Down Expand Up @@ -213,6 +213,13 @@ jobs:
conan profile show -pr default
- name: Conan Cache Restore
shell: bash
run: |
if [ -f ./conan_cache_save.tgz ]; then
conan cache restore ./conan_cache_save.tgz
fi
- name: Configure Install
working-directory: ${{github.workspace}}
shell: bash
Expand Down Expand Up @@ -277,3 +284,6 @@ jobs:
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest --preset ${{ env.CONAN_PRESET }} -LE GPU # Exclude GPU tests as Github actions do not have the supported hardware/drivers

- name: Conan Cache Save
run: conan cache save "*"
12 changes: 11 additions & 1 deletion .github/workflows/code_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
env:
cache-name: cache-conan-data
with:
path: ${{github.workspace}}/.conan2/p
path: ${{github.workspace}}/conan_cache_save.tgz
key: ${{ hashFiles('**/conanfile.py') }}-build-${{ matrix.settings.os }}-${{ matrix.configuration }}-${{ matrix.settings.compiler.conan }}-${{ matrix.settings.compiler.version }}-${{ matrix.settings.lib }}
restore-keys: |
${{ hashFiles('**/conanfile.py') }}-build-${{ matrix.settings.os }}-${{ matrix.configuration }}-${{ matrix.settings.compiler.conan }}-${{ matrix.settings.compiler.version }}-
Expand Down Expand Up @@ -123,6 +123,13 @@ jobs:
conan profile show -pr default
- name: Conan Cache Restore
shell: bash
run: |
if [ -f ./conan_cache_save.tgz ]; then
conan cache restore ./conan_cache_save.tgz
fi
- name: Configure Install
working-directory: ${{github.workspace}}
shell: bash
Expand Down Expand Up @@ -171,3 +178,6 @@ jobs:
with:
working-directory: ${{github.workspace}}/build/${{env.BUILD_TYPE}}/coverage
files: ${{github.workspace}}/build/${{env.BUILD_TYPE}}/coverage/cobertura_coverage.xml

- name: Conan Cache Save
run: conan cache save "*"
12 changes: 11 additions & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
env:
cache-name: cache-conan-data
with:
path: ${{github.workspace}}/.conan2/p
path: ${{github.workspace}}/conan_cache_save.tgz
key: ${{ hashFiles('**/conanfile.py') }}-build-${{ matrix.settings.os }}-${{ matrix.configuration }}-${{ matrix.settings.compiler.conan }}-${{ matrix.settings.compiler.version }}-${{ matrix.settings.lib }}
restore-keys: |
${{ hashFiles('**/conanfile.py') }}-build-${{ matrix.settings.os }}-${{ matrix.configuration }}-${{ matrix.settings.compiler.conan }}-${{ matrix.settings.compiler.version }}-
Expand Down Expand Up @@ -90,6 +90,13 @@ jobs:
conan profile show -pr default
- name: Conan Cache Restore
shell: bash
run: |
if [ -f ./conan_cache_save.tgz ]; then
conan cache restore ./conan_cache_save.tgz
fi
- name: Configure Install
working-directory: ${{github.workspace}}
shell: bash
Expand Down Expand Up @@ -122,3 +129,6 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/documentation/sphinx

- name: Conan Cache Save
run: conan cache save "*"

0 comments on commit a4fe91c

Please sign in to comment.