ci: speed up Rust CI builds (#327)

* ci: speed up Rust CI builds with caching and prebuilt tools

The Windows builder takes ~6min vs ~3min on Ubuntu, largely because
cargo-llvm-cov is compiled from source on every run. This adds
Swatinem/rust-cache for build artifact caching and switches to
taiki-e/install-action for prebuilt cargo-llvm-cov binaries.

Also fixes the undefined `inputs.shell` references by hardcoding `bash`.

* fix: add Swatinem and taiki to cspell dictionary

* ci: remove rust-cache, no measurable benefit for this project

Investigated cache hit/miss across 3 CI runs. Even with warm cache
hits (macOS/Windows), build times were unchanged or slightly slower
due to cache download/extract overhead (~39MB) outweighing the small
dependency compile time savings.

* ci: remove redundant cargo build step

Clippy already compiles all targets, so the explicit cargo build step
was redundant. The test step (cargo llvm-cov) also does its own
instrumented build, so nothing depended on the build step's artifacts.

* ci: try larger Windows runner for faster Rust builds

Switch from windows-latest (4 vCPU) to windows-latest-large (8 vCPU)
to see if the extra cores meaningfully speed up Rust compilation.
Windows builds currently take ~2x longer than macOS/Ubuntu.

* ci: use Namespace Windows runner (8 vCPU) instead of GitHub-hosted

Switch to nscloud-windows-2022-amd64-8x16 to test whether doubling
the cores from 4 to 8 meaningfully speeds up Rust compilation on
Windows, which currently takes ~2x longer than macOS/Ubuntu.

* fix: add nscloud to cspell dictionary
This commit is contained in:
Eric Seidel
2026-04-02 13:34:11 -07:00
committed by GitHub
parent 07fa11c9d9
commit a1f2a9b8bc
3 changed files with 3 additions and 6 deletions
+1 -5
View File
@@ -21,16 +21,12 @@ runs:
shell: bash
run: cargo fmt --check
# No explicit build step needed — clippy already compiles all targets.
- name: Clippy
working-directory: ${{ inputs.working_directory }}
shell: bash
run: cargo clippy --all-targets -- -D warnings
- name: Build
working-directory: ${{ inputs.working_directory }}
shell: bash
run: cargo build --verbose
- name: Test
working-directory: ${{ inputs.working_directory }}
shell: bash
+1 -1
View File
@@ -63,7 +63,7 @@ jobs:
strategy:
matrix:
crate: ${{ fromJSON(needs.changes.outputs.needs_rust_build) }}
os: [macos-latest, windows-latest, ubuntu-latest]
os: [macos-latest, nscloud-windows-2022-amd64-8x16, ubuntu-latest]
runs-on: ${{ matrix.os }}
+1
View File
@@ -57,6 +57,7 @@ words:
- mockall
- mocktail
- msvc
- nscloud
- oslog
- pubspec
- repr