Skip to content

Commit

Permalink
CI: Enable rust caching for Windows, if vcpkg dependencies unchanged.
Browse files Browse the repository at this point in the history
Our non-Rust dependency versions are fixed on Windows by our choice of
vcpkg commit ID, so by using this as a key to the rust-cache action, we
can cache safely.
  • Loading branch information
martinling committed Jul 31, 2024
1 parent e27176c commit d9c1c4d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,17 @@ jobs:
runs-on: ${{ matrix.os }}

env:
VCPKG_COMMIT: 01f602195983451bc83e72f4214af2cbc495aa94 # 2024.05.24 release
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg/installed

steps:
- uses: actions/checkout@v4

- uses: Swatinem/rust-cache@v2
with:
env-vars: VCPKG_COMMIT
if: runner.os == 'Windows'

- name: Install toolchain
run: |
rustup toolchain install ${{ matrix.rust }}
Expand Down Expand Up @@ -79,7 +85,7 @@ jobs:
- name: Install dependencies (Windows)
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: 01f602195983451bc83e72f4214af2cbc495aa94 # 2024.05.24 release
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT }}
runVcpkgInstall: true
doNotCache: false
if: matrix.os == 'windows-latest'
Expand Down

0 comments on commit d9c1c4d

Please sign in to comment.