Skip to content

Commit b0dce6e

Browse files
authored
ci: use install-cargo-tool action with cargo install fallback (#61)
Replaces all remaining `taiki-e/install-action@v2` usages with the `install-cargo-tool` composite action added to windows-drivers-rs in PR microsoft/windows-drivers-rs#625. This gives every cargo tool install step an automatic `cargo install` fallback when `install-action` silently fails on `windows-11-arm` runners under WoW64 arm64 emulation (see actions/partner-runner-images#169). For the `machete` job in `lint.yaml` and the `taplo-fmt` job in `code-formatting-check.yaml`, also adds the sparse-checkout + copy steps to pull shared actions from windows-drivers-rs (matching the pattern already used in `build.yaml`, `docs.yaml`, and the clippy job in `lint.yaml`).
1 parent d5b7b6e commit b0dce6e

3 files changed

Lines changed: 26 additions & 4 deletions

File tree

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102

103103
# Steps to use cargo-make to build and package drivers
104104
- name: Install Cargo Make
105-
uses: taiki-e/install-action@v2
105+
uses: ./.github/actions/install-cargo-tool
106106
with:
107107
tool: cargo-make
108108

.github/workflows/code-formatting-check.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,18 @@ jobs:
3939
- name: Install Rust Toolchain (Stable)
4040
uses: dtolnay/rust-toolchain@stable
4141

42-
- name: Install taplo-cli
43-
uses: taiki-e/install-action@v2
42+
# Using cache-cargo-install-action to cache the compiled binary.
43+
# Once taplo ships a release with field-level `keys` matching, this can
44+
# be simplified back to install-action with a normal version pin.
45+
- name: Install taplo-cli from pinned revision b673b44d
46+
uses: taiki-e/cache-cargo-install-action@v3
4447
with:
4548
tool: taplo-cli
49+
git: https://github.com/tamasfe/taplo
50+
rev: b673b44d
51+
locked: true
52+
env:
53+
RUSTFLAGS: ""
4654

4755
- run: taplo fmt --check --diff
4856
name: Check TOML files formatting

.github/workflows/lint.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,25 @@ jobs:
112112
- name: Checkout Repository
113113
uses: actions/checkout@v4
114114

115+
- name: Checkout windows-drivers-rs actions
116+
uses: actions/checkout@v4
117+
with:
118+
repository: microsoft/windows-drivers-rs
119+
ref: main
120+
path: _temp/windows-drivers-rs
121+
sparse-checkout: |
122+
.github/actions
123+
sparse-checkout-cone-mode: false
124+
125+
- name: Copy actions to workspace
126+
shell: pwsh
127+
run: Copy-Item -Recurse -Force _temp/windows-drivers-rs/.github/actions .github/
128+
115129
- name: Install Rust Toolchain
116130
uses: dtolnay/rust-toolchain@stable
117131

118132
- name: Install Cargo Machete
119-
uses: taiki-e/install-action@v2
133+
uses: ./.github/actions/install-cargo-tool
120134
with:
121135
tool: cargo-machete
122136

0 commit comments

Comments
 (0)