Use actions/cache instead of vcpkg built-in cache feature

This commit is contained in:
Hiroshi SHIBATA 2025-04-25 13:13:24 +09:00
parent 08f62809ea
commit ffa40d3418
Notes: git 2025-04-25 05:24:56 +00:00

View File

@ -66,7 +66,6 @@ jobs:
env: env:
GITPULLOPTIONS: --no-tags origin ${{ github.ref }} GITPULLOPTIONS: --no-tags origin ${{ github.ref }}
OS_VER: windows-${{ matrix.os < 2022 && '2019' || matrix.os }} OS_VER: windows-${{ matrix.os < 2022 && '2019' || matrix.os }}
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
VCPKG_DEFAULT_TRIPLET: ${{ matrix.target || 'x64' }}-windows VCPKG_DEFAULT_TRIPLET: ${{ matrix.target || 'x64' }}-windows
RUBY_OPT_DIR: ${{ matrix.os == '11-arm' && 'C' || 'D' }}:/a/ruby/ruby/src/vcpkg_installed/%VCPKG_DEFAULT_TRIPLET% RUBY_OPT_DIR: ${{ matrix.os == '11-arm' && 'C' || 'D' }}:/a/ruby/ruby/src/vcpkg_installed/%VCPKG_DEFAULT_TRIPLET%
@ -89,13 +88,6 @@ jobs:
scoop install vcpkg uutils-coreutils cmake@3.31.6 scoop install vcpkg uutils-coreutils cmake@3.31.6
shell: pwsh shell: pwsh
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with: with:
sparse-checkout-cone-mode: false sparse-checkout-cone-mode: false
@ -141,6 +133,13 @@ jobs:
run: Get-Volume run: Get-Volume
shell: pwsh shell: pwsh
# vcpkg built-in cache is not working now
- name: Restore vcpkg artifact
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: C:\Users\runneradmin\AppData\Local\vcpkg\archives
key: vcpkg-${{ matrix.target || 'x64' }}-${{ hashFiles('src/vcpkg.json') }}
- name: Install libraries with vcpkg - name: Install libraries with vcpkg
run: | run: |
vcpkg install --vcpkg-root=C:\Users\runneradmin\scoop\apps\vcpkg\current vcpkg install --vcpkg-root=C:\Users\runneradmin\scoop\apps\vcpkg\current