Skip to content

Commit 7c3c493

Browse files
committed
ci: fixed vcpkg binary assets cache updating
1 parent 64d2a04 commit 7c3c493

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/codeql-analysis.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ jobs:
8484
shell: bash
8585
run: mkdir -p $VCPKG_DEFAULT_BINARY_CACHE
8686

87+
- name: Obtain running job information
88+
uses: qoomon/actions--context@v4
89+
8790
# Restore vcpkg from the GitHub Action cache service. Note that packages are restored by vcpkg's binary caching
8891
# when it is being run afterwards by CMake.
8992
- name: Restore cached vcpkg binary assets
@@ -99,8 +102,8 @@ jobs:
99102
!${{ env.VCPKG_ROOT }}/downloads
100103
!${{ env.VCPKG_ROOT }}/installed
101104
# The key is composed in a way that it gets properly invalidated whenever a different version of vcpkg is being used.
102-
key: |
103-
vcpkg-${{ hashFiles('.git/modules/external/vcpkg/HEAD') }}-${{ runner.os }}
105+
key: vcpkg-${{ hashFiles('.git/modules/external/vcpkg/HEAD') }}-${{ runner.os }}-${{ env.GITHUB_JOB_ID }}
106+
restore-keys: vcpkg-${{ hashFiles('.git/modules/external/vcpkg/HEAD') }}-${{ runner.os }}
104107

105108
- name: Configure CMake
106109
working-directory: ${{ github.workspace }}/build

.github/workflows/nightly-builds.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ jobs:
7575
shell: bash
7676
run: mkdir -p ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
7777

78+
- name: Obtain running job information
79+
uses: qoomon/actions--context@v4
80+
7881
# Restore vcpkg from the GitHub Action cache service. Note that packages are restored by vcpkg's binary caching
7982
# when it is being run afterwards by CMake.
8083
- name: Caching of vcpkg assets
@@ -90,8 +93,8 @@ jobs:
9093
!${{ env.VCPKG_ROOT }}/downloads
9194
!${{ env.VCPKG_ROOT }}/installed
9295
# The key is composed in a way that it gets properly invalidated whenever a different version of vcpkg is being used.
93-
key: |
94-
vcpkg-${{ hashFiles('.git/modules/external/vcpkg/HEAD') }}-${{ runner.os }}
96+
key: vcpkg-${{ hashFiles('.git/modules/external/vcpkg/HEAD') }}-${{ runner.os }}-${{ env.GITHUB_JOB_ID }}
97+
restore-keys: vcpkg-${{ hashFiles('.git/modules/external/vcpkg/HEAD') }}-${{ runner.os }}
9598

9699
- name: Configure CMake
97100
working-directory: ${{ github.workspace }}/build

0 commit comments

Comments
 (0)