mirror of
https://github.com/Xahau/xahaud.git
synced 2026-04-29 15:37:46 +00:00
[CONAN] cache build directory too
This commit is contained in:
15
.github/workflows/macos-ga.yml
vendored
15
.github/workflows/macos-ga.yml
vendored
@@ -111,18 +111,23 @@ jobs:
|
||||
~/.conan2
|
||||
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
|
||||
|
||||
# Add this step to generate a safe branch name
|
||||
- name: Generate safe branch name
|
||||
id: safe-branch
|
||||
run: |
|
||||
# Replace characters that aren't allowed in cache keys
|
||||
SAFE_BRANCH=$(echo "${{ github.ref_name }}" | tr -c 'a-zA-Z0-9_.-' '-')
|
||||
echo "name=${SAFE_BRANCH}" >> $GITHUB_OUTPUT
|
||||
|
||||
# After your cache restore for Conan but before the build step
|
||||
- name: Restore build directory cache
|
||||
id: build-cache-restore
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: ${{ env.build_dir }}
|
||||
# Primary key without SHA - much higher hit probability
|
||||
key: ${{ runner.os }}-build-${{ matrix.configuration }}-${{ github.ref_name }}-${{ hashFiles('**/conanfile.txt', '**/conanfile.py') }}
|
||||
key: ${{ runner.os }}-build-${{ matrix.configuration }}-${{ steps.safe-branch.outputs.name }}-${{ hashFiles('**/conanfile.txt', '**/conanfile.py') }}
|
||||
restore-keys: |
|
||||
# Same branch, different dependencies
|
||||
${{ runner.os }}-build-${{ matrix.configuration }}-${{ github.ref_name }}-
|
||||
# Same configuration, any branch
|
||||
${{ runner.os }}-build-${{ matrix.configuration }}-${{ steps.safe-branch.outputs.name }}-
|
||||
${{ runner.os }}-build-${{ matrix.configuration }}-
|
||||
|
||||
# Build still calls the install dependency installation every time
|
||||
|
||||
15
.github/workflows/nix-ga.yml
vendored
15
.github/workflows/nix-ga.yml
vendored
@@ -109,18 +109,21 @@ jobs:
|
||||
${{ matrix.cc }} --version
|
||||
${{ matrix.cxx }} --version
|
||||
|
||||
# After your Conan cache restore but before the build step
|
||||
- name: Generate safe branch name
|
||||
id: safe-branch
|
||||
run: |
|
||||
# Replace characters that aren't allowed in cache keys
|
||||
SAFE_BRANCH=$(echo "${{ github.ref_name }}" | tr -c 'a-zA-Z0-9_.-' '-')
|
||||
echo "name=${SAFE_BRANCH}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Restore build directory cache
|
||||
id: build-cache-restore
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: ${{ env.build_dir }}
|
||||
# Primary key without SHA - much higher hit probability
|
||||
key: ${{ runner.os }}-build-${{ matrix.compiler }}-${{ matrix.configuration }}-${{ github.ref_name }}-${{ hashFiles('**/conanfile.txt', '**/conanfile.py') }}
|
||||
key: ${{ runner.os }}-build-${{ matrix.compiler }}-${{ matrix.configuration }}-${{ steps.safe-branch.outputs.name }}-${{ hashFiles('**/conanfile.txt', '**/conanfile.py') }}
|
||||
restore-keys: |
|
||||
# Same branch, different dependencies
|
||||
${{ runner.os }}-build-${{ matrix.compiler }}-${{ matrix.configuration }}-${{ github.ref_name }}-
|
||||
# Same compiler/config, any branch
|
||||
${{ runner.os }}-build-${{ matrix.compiler }}-${{ matrix.configuration }}-${{ steps.safe-branch.outputs.name }}-
|
||||
${{ runner.os }}-build-${{ matrix.compiler }}-${{ matrix.configuration }}-
|
||||
|
||||
- name: Build
|
||||
|
||||
Reference in New Issue
Block a user