Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

Commit

Permalink
fix: Different cmake cache for projects (#33)
Browse files Browse the repository at this point in the history
* fix: Different cmake cache for projects

* fix: Change cache key for conan
  • Loading branch information
CaptainIRS authored Feb 26, 2022
1 parent b2288c2 commit ed5597b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

env:
BUILD_TYPE: Release
BUILD_PROJECT: all
CC: gcc-11
CXX: g++-11

Expand Down Expand Up @@ -42,7 +43,7 @@ jobs:
uses: actions/cache@v2
with:
path: /home/runner/.conan
key: conan-cache-tmp-${{ hashFiles('conanfile.txt') }}
key: conan-cache-tmp-${{ hashFiles('conanfile.txt') }}-${{ env.BUILD_PROJECT }}

- name: Install conan dependencies
if: steps.cache-conan.outputs.cache-hit != 'true'
Expand All @@ -53,11 +54,11 @@ jobs:
uses: actions/cache@v2
with:
path: ${{github.workspace}}/build
key: cmake-cache-tmp-${{ hashFiles('CMakeLists.txt') }}
key: cmake-cache-tmp-${{ hashFiles('CMakeLists.txt') }}-${{ env.BUILD_PROJECT }}

- name: Configure CMake
if: steps.cache-cmake.outputs.cache-hit != 'true'
run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_PROJECT=${{env.BUILD_PROJECT}}

- name: Build
working-directory: ${{github.workspace}}/build
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

env:
BUILD_TYPE: Release
BUILD_PROJECT: no_tests
CC: gcc-11
CXX: g++-11

Expand Down Expand Up @@ -41,7 +42,7 @@ jobs:
uses: actions/cache@v2
with:
path: /home/runner/.conan
key: conan-cache-${{ hashFiles('conanfile.txt') }}
key: conan-cache-${{ hashFiles('conanfile.txt') }}-${{ env.BUILD_PROJECT }}

- name: Install conan dependencies
if: steps.cache-conan.outputs.cache-hit != 'true'
Expand All @@ -52,11 +53,11 @@ jobs:
uses: actions/cache@v2
with:
path: ${{github.workspace}}/build
key: cmake-cache-tmp-${{ hashFiles('CMakeLists.txt') }}
key: cmake-cache-tmp-${{ hashFiles('CMakeLists.txt') }}-${{ env.BUILD_PROJECT }}

- name: Configure CMake
if: steps.cache-cmake.outputs.cache-hit != 'true'
run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_PROJECT="no_tests"
run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_PROJECT=${{env.BUILD_PROJECT}}

- name: Build
working-directory: ${{github.workspace}}/build
Expand Down

0 comments on commit ed5597b

Please sign in to comment.