Skip to content

Commit 46607b9

Browse files
authored
Pin Viceroy install to v0.16.4 in test workflow (#656)
* Pin Viceroy install to v0.16.4 in test workflow Upstream Viceroy 0.16.6 bumped its MSRV to rustc 1.95, but this repo pins rustc 1.91.1 in rust-toolchain.toml. The test workflow installed Viceroy from HEAD, so CI picked up 0.16.6 and failed to compile with "viceroy-lib@0.16.6 requires rustc 1.95". Pin to v0.16.4, matching the tag already used by .github/actions/setup-integration-test-env/action.yml. Drop the ls-remote cache-key step since a fixed tag is now the cache key. * Read Viceroy version from .tool-versions in CI Adds `viceroy 0.16.4` to `.tool-versions` and rewires both the `Run Tests` workflow and the `setup-integration-test-env` composite action to read the tag from there via grep. `.tool-versions` is now the single source of truth, so the two workflows can no longer drift on the pin. The pin is still required because upstream Viceroy > v0.16.4 bumped MSRV beyond the rustc pin in rust-toolchain.toml.
1 parent 39b4174 commit 46607b9

3 files changed

Lines changed: 24 additions & 9 deletions

File tree

.github/actions/setup-integration-test-env/action.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ runs:
4545
shell: bash
4646
run: echo "node-version=$(grep '^nodejs ' .tool-versions | awk '{print $2}')" >> "$GITHUB_OUTPUT"
4747

48+
- name: Retrieve Viceroy version
49+
id: viceroy-version
50+
if: ${{ inputs.install-viceroy == 'true' }}
51+
shell: bash
52+
# `.tool-versions` is the single source of truth for the Viceroy pin.
53+
# The pin matters because upstream Viceroy > v0.16.4 has bumped MSRV
54+
# beyond the rustc pin in `rust-toolchain.toml`.
55+
run: echo "viceroy-version=$(grep '^viceroy ' .tool-versions | awk '{print $2}')" >> "$GITHUB_OUTPUT"
56+
4857
- name: Set up Rust toolchain
4958
uses: actions-rust-lang/setup-rust-toolchain@v1
5059
with:
@@ -58,12 +67,12 @@ runs:
5867
uses: actions/cache@v4
5968
with:
6069
path: ~/.cargo/bin/viceroy
61-
key: viceroy-${{ runner.os }}-v0.16.4
70+
key: viceroy-${{ runner.os }}-v${{ steps.viceroy-version.outputs.viceroy-version }}
6271

6372
- name: Install Viceroy
6473
if: ${{ inputs.install-viceroy == 'true' && steps.cache-viceroy.outputs.cache-hit != 'true' }}
6574
shell: bash
66-
run: cargo install --git https://github.com/fastly/Viceroy --tag v0.16.4 viceroy
75+
run: cargo install --git https://github.com/fastly/Viceroy --tag v${{ steps.viceroy-version.outputs.viceroy-version }} viceroy
6776

6877
- name: Build WASM binary
6978
if: ${{ inputs.build-wasm == 'true' }}

.github/workflows/test.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,32 @@ jobs:
2121
run: echo "rust-version=$(grep '^rust ' .tool-versions | awk '{print $2}')" >> $GITHUB_OUTPUT
2222
shell: bash
2323

24+
- name: Retrieve Viceroy version
25+
id: viceroy-version
26+
# `.tool-versions` is the single source of truth so this workflow and
27+
# `.github/actions/setup-integration-test-env/action.yml` can't drift.
28+
# The pin matters because upstream Viceroy > v0.16.4 has bumped MSRV
29+
# beyond the rustc pin in `rust-toolchain.toml`.
30+
run: echo "viceroy-version=$(grep '^viceroy ' .tool-versions | awk '{print $2}')" >> $GITHUB_OUTPUT
31+
shell: bash
32+
2433
- name: Set up Rust toolchain
2534
uses: actions-rust-lang/setup-rust-toolchain@v1
2635
with:
2736
toolchain: ${{ steps.rust-version.outputs.rust-version }}
2837
target: wasm32-wasip1
2938
cache-shared-key: cargo-${{ runner.os }}
3039

31-
- name: Get Viceroy cache key
32-
id: viceroy-rev
33-
run: echo "sha=$(git ls-remote https://github.com/fastly/Viceroy HEAD | cut -f1)" >> $GITHUB_OUTPUT
34-
3540
- name: Cache Viceroy binary
3641
id: cache-viceroy
3742
uses: actions/cache@v4
3843
with:
3944
path: ~/.cargo/bin/viceroy
40-
key: viceroy-${{ runner.os }}-${{ steps.viceroy-rev.outputs.sha }}
45+
key: viceroy-${{ runner.os }}-v${{ steps.viceroy-version.outputs.viceroy-version }}
4146

42-
- name: Install Viceroy (from main since 0.14.3 is broken)
47+
- name: Install Viceroy
4348
if: steps.cache-viceroy.outputs.cache-hit != 'true'
44-
run: cargo install --git https://github.com/fastly/Viceroy viceroy
49+
run: cargo install --git https://github.com/fastly/Viceroy --tag v${{ steps.viceroy-version.outputs.viceroy-version }} viceroy
4550

4651
- name: Run tests
4752
run: cargo test --workspace

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
fastly 13.3.0
22
rust 1.91.1
33
nodejs 24.12.0
4+
viceroy 0.16.4

0 commit comments

Comments
 (0)