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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user