|
37 | 37 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
38 | 38 | # Enables the vcpkg dependency graph integration. |
39 | 39 | VCPKG_FEATURE_FLAGS: dependencygraph |
40 | | - # Let's use GitHub Action cache as storage for the vcpkg Binary Caching feature. |
41 | | - VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite' |
42 | 40 | steps: |
43 | | - # Set env vars needed for vcpkg to leverage the GitHub Action cache as a storage |
44 | | - # for Binary Caching. |
45 | | - - name: Set env vars needed for vcpkg to leverage the GitHub Action cache |
46 | | - uses: actions/github-script@v6 |
47 | | - with: |
48 | | - script: | |
49 | | - core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); |
50 | | - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); |
51 | | -
|
52 | 41 | - name: Checkout repository |
53 | 42 | uses: actions/checkout@v4 |
54 | 43 | with: |
|
63 | 52 | with: |
64 | 53 | arch: ${{ matrix.devenv_arch }} |
65 | 54 |
|
66 | | - - name: Dynamically set vcpkg-related environment variables |
67 | | - # We need this because previous step overwrites VCPKG_ROOT envvar on Windows runners |
68 | | - uses: actions/github-script@v6 |
| 55 | + # We need this because previous step overwrites VCPKG_ROOT envvar on Windows runners |
| 56 | + - name: Setup vcpkg-related environment variables |
| 57 | + uses: actions/github-script@v7 |
69 | 58 | with: |
70 | 59 | script: | |
71 | 60 | core.exportVariable('VCPKG_ROOT', `${process.env.GITHUB_WORKSPACE}/external/vcpkg`.replaceAll('\\', '/')); |
|
87 | 76 |
|
88 | 77 | # Restore vcpkg from the GitHub Action cache service. Note that packages are restored by vcpkg's binary caching |
89 | 78 | # when it is being run afterwards by CMake. |
90 | | - - name: Restore vcpkg |
91 | | - uses: actions/cache@v3 |
| 79 | + - name: Caching of vcpkg assets |
| 80 | + uses: actions/cache@v4 |
92 | 81 | with: |
93 | 82 | # The first path is the location of vcpkg: it contains the vcpkg executable and data files, as long as the |
94 | 83 | # built package archives (aka binary cache) which are located by VCPKG_DEFAULT_BINARY_CACHE env var. |
|
101 | 90 | !${{ env.VCPKG_ROOT }}/installed |
102 | 91 | # The key is composed in a way that it gets properly invalidated whenever a different version of vcpkg is being used. |
103 | 92 | key: | |
104 | | - ${{ hashFiles( '.git/modules/external/vcpkg/HEAD' )}} |
| 93 | + vcpkg-${{ hashFiles('.git/modules/external/vcpkg/HEAD') }}-${{ runner.os }} |
105 | 94 |
|
106 | 95 | - name: Configure CMake |
107 | 96 | working-directory: ${{ github.workspace }}/build |
|
0 commit comments