Skip to content

Commit

Permalink
ci: Don't install unneeded rust components by default (#2011)
Browse files Browse the repository at this point in the history
* ci: Don't install unneeded rust components by default

Should speed up some CI checks.

* components -> tools

* Commas

* Quote

* Pipe

* Optimize

* Fix

* Fix

* rustup
  • Loading branch information
larseggert authored Jul 29, 2024
1 parent 67a7ee0 commit e8dfd5b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
12 changes: 7 additions & 5 deletions .github/actions/rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,28 @@ inputs:
components:
description: 'Rust components to install'
default: ''
tools:
description: 'Additional Rust tools to install'
default: ''

runs:
using: composite
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@bb45937a053e097f8591208d8e74c90db1873d07 # master
uses: dtolnay/rust-toolchain@21dc36fb71dd22e3317045c0c31a3f4249868b17 # master
with:
toolchain: ${{ inputs.version }}
components: ${{ inputs.components }}

- name: Install cargo-quickinstall
shell: bash
if: inputs.tools != ''
run: cargo +${{ inputs.version }} install cargo-quickinstall

- name: Install Rust tools
shell: bash
run: |
cargo +${{ inputs.version }} quickinstall --no-binstall \
cargo-llvm-cov cargo-nextest flamegraph cargo-hack cargo-mutants hyperfine \
cargo-machete cargo-fuzz
if: inputs.tools != ''
run: cargo +${{ inputs.version }} quickinstall --no-binstall $(echo ${{ inputs.tools }} | tr -d ",")

# sccache slows CI down, so we leave it disabled.
# Leaving the steps below commented out, so we can re-evaluate enabling it later.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
uses: ./.github/actions/rust
with:
version: $TOOLCHAIN
components: rustfmt
tools: hyperfine

- name: Fetch and build NSS and NSPR
uses: ./.github/actions/nss
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
if: runner.os == 'MacOS'
run: |
brew update
brew upgrade rustup
brew install llvm nss
echo "/opt/homebrew/opt/llvm/bin" >> "$GITHUB_PATH"
echo "RUSTFLAGS=-C link-arg=-fuse-ld=lld" >> "$GITHUB_ENV"
Expand Down Expand Up @@ -96,6 +97,7 @@ jobs:
with:
version: ${{ matrix.rust-toolchain }}
components: rustfmt, clippy, llvm-tools-preview
tools: cargo-llvm-cov, cargo-nextest, cargo-hack, cargo-fuzz, cargo-machete

- name: Fetch and build NSS and NSPR
uses: ./.github/actions/nss
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/mutants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
uses: ./.github/actions/rust
with:
version: stable
tools: cargo-mutants

- name: Find incremental mutants
if: github.event_name == 'pull_request'
Expand Down

0 comments on commit e8dfd5b

Please sign in to comment.