ci: fix cache key to include stdlib choice

This commit is contained in:
Nicholas Dudfield
2025-08-18 18:12:11 +07:00
parent 4b9ef8db22
commit 5286bae753
2 changed files with 11 additions and 5 deletions

View File

@@ -25,6 +25,10 @@ inputs:
description: 'Main branch name for restore keys'
required: false
default: 'dev'
stdlib_choice:
description: 'Standard library choice (affects cache key for different stdlib builds)'
required: false
default: 'default'
outputs:
cache-hit:
@@ -50,10 +54,10 @@ runs:
path: |
~/.conan
~/.conan2
key: ${{ runner.os }}-conan-v${{ inputs.cache_version }}-${{ inputs.compiler-id }}-${{ hashFiles('**/conanfile.txt', '**/conanfile.py') }}-${{ inputs.configuration }}
key: ${{ runner.os }}-conan-v${{ inputs.cache_version }}-${{ inputs.compiler-id }}-${{ inputs.stdlib_choice }}-${{ hashFiles('**/conanfile.txt', '**/conanfile.py') }}-${{ inputs.configuration }}
restore-keys: |
${{ runner.os }}-conan-v${{ inputs.cache_version }}-${{ inputs.compiler-id }}-${{ hashFiles('**/conanfile.txt', '**/conanfile.py') }}-
${{ runner.os }}-conan-v${{ inputs.cache_version }}-${{ inputs.compiler-id }}-
${{ runner.os }}-conan-v${{ inputs.cache_version }}-${{ inputs.compiler-id }}-${{ inputs.stdlib_choice }}-${{ hashFiles('**/conanfile.txt', '**/conanfile.py') }}-
${{ runner.os }}-conan-v${{ inputs.cache_version }}-${{ inputs.compiler-id }}-${{ inputs.stdlib_choice }}-
- name: Export custom recipes
shell: bash

View File

@@ -27,6 +27,7 @@ jobs:
# cxx: g++-13
# compiler_id: gcc-13
# compiler_version: 13
# force_libstdcpp: false
- compiler: clang
cc: clang-14
cxx: clang++-14
@@ -72,7 +73,7 @@ jobs:
conan profile update settings.compiler.cppstd=20 default
conan profile update settings.compiler=${{ matrix.compiler }} default
# Use libstdc++11 for clang when force_libstdcpp is enabled, otherwise use libc++
if [ "${{ matrix.compiler }}" = "clang" ] && [ "${{ matrix.force_libstdcpp || 'false' }}" = "true" ]; then
if [ "${{ matrix.compiler }}" = "clang" ] && [ "${{ matrix.force_libstdcpp }}" = "true" ]; then
conan profile update settings.compiler.libcxx=libstdc++11 default
elif [ "${{ matrix.compiler }}" = "clang" ]; then
conan profile update settings.compiler.libcxx=libc++ default
@@ -108,6 +109,7 @@ jobs:
compiler-id: ${{ matrix.compiler_id }}
cache_version: ${{ env.CACHE_VERSION }}
main_branch: ${{ env.MAIN_BRANCH_NAME }}
stdlib_choice: ${{ matrix.force_libstdcpp }}
- name: Build
uses: ./.github/actions/xahau-ga-build
@@ -120,7 +122,7 @@ jobs:
compiler-id: ${{ matrix.compiler_id }}
cache_version: ${{ env.CACHE_VERSION }}
main_branch: ${{ env.MAIN_BRANCH_NAME }}
clang_use_libstdcpp: ${{ matrix.force_libstdcpp || 'false' }}
clang_use_libstdcpp: ${{ matrix.force_libstdcpp }}
- name: Set artifact name
id: set-artifact-name