From 41d90cc917e3410fdb5f4438ced930079081f13a Mon Sep 17 00:00:00 2001 From: Antony Peacock Date: Fri, 6 Jan 2023 13:05:36 +0000 Subject: [PATCH] Update all workflows to use new Conan cache key --- .github/workflows/ci-test-package-cmake.yml | 10 ++++++---- .github/workflows/codeql-analysis.yml | 20 +++++++++++++------- .github/workflows/documentation.yml | 20 +++++++++++++------- 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci-test-package-cmake.yml b/.github/workflows/ci-test-package-cmake.yml index d0692b62..8649d0bc 100644 --- a/.github/workflows/ci-test-package-cmake.yml +++ b/.github/workflows/ci-test-package-cmake.yml @@ -187,11 +187,13 @@ jobs: cache-name: cache-conan-data with: path: ~/.conan/data - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/metadata.json') }} + key: build-${{ matrix.config.os }}-${{ matrix.build_type }}-${{ matrix.config.compiler.type }}-${{ matrix.config.compiler.version }}-${{ matrix.config.lib }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- + build-${{ matrix.config.os }}-${{ matrix.build_type }}-${{ matrix.config.compiler.type }}-${{ matrix.config.compiler.version }}-${{ matrix.config.lib }} + build-${{ matrix.config.os }}-${{ matrix.build_type }}-${{ matrix.config.compiler.type }}-${{ matrix.config.compiler.version }}- + build-${{ matrix.config.os }}-${{ matrix.build_type }}-${{ matrix.config.compiler.type }}- + build-${{ matrix.config.os }}-${{ matrix.build_type }}- + build-${{ matrix.config.os }}- - name: Install gcc-11 if: matrix.config.compiler.type == 'GCC' && matrix.config.compiler.version == '11' shell: bash diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index ee26cd5d..51d6144b 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -25,11 +25,15 @@ on: jobs: analyze: name: Analyze - runs-on: ubuntu-22.04 + runs-on: ${{ env.OS }} env: CC: gcc-10 CXX: g++-10 - + OS: ubuntu-22.04 + BUILD_TYPE: Debug + COMPILER_TYPE: GCC + COMPILER_VERSION: 10 + STDLIB: libstdc++11 strategy: fail-fast: false matrix: @@ -68,11 +72,13 @@ jobs: cache-name: cache-conan-data with: path: ~/.conan/data - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/metadata.json') }} + key: build-${{ env.OS }}-${{ env.BUILD_TYPE }}-${{ env.COMPILER_TYPE }}-${{ env.COMPILER_VERSION }}-${{ env.STDLIB }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- + build-${{ env.OS }}-${{ env.BUILD_TYPE }}-${{ env.COMPILER_TYPE }}-${{ env.COMPILER_VERSION }}-${{ env.STDLIB }} + build-${{ env.OS }}-${{ env.BUILD_TYPE }}-${{ env.COMPILER_TYPE }}-${{ env.COMPILER_VERSION }}- + build-${{ env.OS }}-${{ env.BUILD_TYPE }}-${{ env.COMPILER_TYPE }}- + build-${{ env.OS }}-${{ env.BUILD_TYPE }}- + build-${{ env.OS }}- - name: Set up Python if: matrix.language == 'cpp' uses: actions/setup-python@v4 @@ -85,7 +91,7 @@ jobs: conan config init conan remote add upload https://mpusz.jfrog.io/artifactory/api/conan/conan-oss mkdir _lgtm_build_dir && cd _lgtm_build_dir - conan install .. -s compiler.cppstd=20 -s compiler.libcxx=libstdc++11 -c user.build:all=True -c user.build:skip_docs=True -b outdated -u + conan install .. -s compiler.cppstd=20 -s compiler.libcxx=${{ env.STDLIB }} -c user.build:all=True -c user.build:skip_docs=True -b outdated -u conan build .. - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index b80ec678..b2d8bc23 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -41,11 +41,15 @@ env: CXX: g++-10 CMAKE_GENERATOR: Ninja CONAN_CMAKE_GENERATOR: Ninja - + OS: ubuntu-22.04 + BUILD_TYPE: Debug + COMPILER_TYPE: GCC + COMPILER_VERSION: 10 + STDLIB: libstdc++11 jobs: docs: name: Generate documentation - runs-on: ubuntu-22.04 + runs-on: ${{ env.OS }} steps: - uses: actions/checkout@v3 - name: Cache Conan data @@ -54,11 +58,13 @@ jobs: cache-name: cache-conan-data with: path: ~/.conan/data - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/metadata.json') }} + key: build-${{ env.OS }}-${{ env.BUILD_TYPE }}-${{ env.COMPILER_TYPE }}-${{ env.COMPILER_VERSION }}-${{ env.STDLIB }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- + build-${{ env.OS }}-${{ env.BUILD_TYPE }}-${{ env.COMPILER_TYPE }}-${{ env.COMPILER_VERSION }}-${{ env.STDLIB }} + build-${{ env.OS }}-${{ env.BUILD_TYPE }}-${{ env.COMPILER_TYPE }}-${{ env.COMPILER_VERSION }}- + build-${{ env.OS }}-${{ env.BUILD_TYPE }}-${{ env.COMPILER_TYPE }}- + build-${{ env.OS }}-${{ env.BUILD_TYPE }}- + build-${{ env.OS }}- - name: Install Ninja run: | sudo apt install -y ninja-build @@ -78,7 +84,7 @@ jobs: conan remote add -i 0 upload https://mpusz.jfrog.io/artifactory/api/conan/conan-oss - name: Install Conan dependencies run: | - conan install . -s compiler.cppstd=20 -s compiler.libcxx=libstdc++11 -c user.build:all=True -c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" -b outdated -u + conan install . -s compiler.cppstd=20 -s compiler.libcxx=${{ env.STDLIB }} -c user.build:all=True -c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" -b outdated -u - name: Configure CMake run: | cmake --preset default