From 0af491b628a722751674e985ea493a55a64812bc Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Wed, 1 Apr 2026 20:14:24 -0700 Subject: [PATCH] ci: speed up Rust CI builds with prebuilt tools (#325) * 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. --- .github/actions/rust_crate/action.yaml | 17 +++++++++-------- cspell.config.yaml | 2 ++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/actions/rust_crate/action.yaml b/.github/actions/rust_crate/action.yaml index 5710206..460b494 100644 --- a/.github/actions/rust_crate/action.yaml +++ b/.github/actions/rust_crate/action.yaml @@ -13,34 +13,35 @@ inputs: runs: using: "composite" steps: + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + - name: Check Formatting working-directory: ${{ inputs.working_directory }} - shell: ${{ inputs.shell }} + shell: bash run: cargo fmt --check - name: Clippy working-directory: ${{ inputs.working_directory }} - shell: ${{ inputs.shell }} + shell: bash run: cargo clippy --all-targets -- -D warnings - name: Build working-directory: ${{ inputs.working_directory }} - shell: ${{ inputs.shell }} + shell: bash run: cargo build --verbose - name: Test working-directory: ${{ inputs.working_directory }} - shell: ${{ inputs.shell }} - run: | - cargo install cargo-llvm-cov - cargo llvm-cov --lcov --output-path lcov.info + shell: bash + run: cargo llvm-cov --lcov --output-path lcov.info # Per https://stackoverflow.com/questions/73402042/github-action-expressions-split-string - name: Split package name env: PACKAGE_PATH: ${{ inputs.working_directory}} id: split - shell: ${{ inputs.shell }} + shell: bash run: echo "package_name=${PACKAGE_PATH##*/}" >> $GITHUB_OUTPUT - name: Upload Coverage diff --git a/cspell.config.yaml b/cspell.config.yaml index 5e47dec..60541af 100644 --- a/cspell.config.yaml +++ b/cspell.config.yaml @@ -75,6 +75,8 @@ words: - unbootable - unbooted - usize + - Swatinem + - taiki - Verdana - vmcode - withf