Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
Install clippy/rustfmt only when necessary
Browse files Browse the repository at this point in the history
With how rust-cache works, I think these component binaries will be
ignored when keying and won't bust the cache, so we don't have to waste
time installing them when they're not used.
  • Loading branch information
elasticdog committed May 5, 2023
1 parent 642f10c commit 9c912b0
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/cue/rust.cue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ rust: _#useMergeQueue & {
if: "needs.changes.outputs.rust == 'true' && github.event_name == 'pull_request'"
steps: [
_#checkoutCode,
_#installRust,
_#installRust & {with: components: "rustfmt"},
_#cacheRust,
{
name: "Check formatting"
Expand All @@ -49,7 +49,7 @@ rust: _#useMergeQueue & {
if: "needs.changes.outputs.rust == 'true' && github.event_name == 'pull_request'"
steps: [
_#checkoutCode,
_#installRust,
_#installRust & {with: components: "clippy"},
_#cacheRust,
{
name: "Check lints"
Expand Down
4 changes: 2 additions & 2 deletions .github/cue/shared-steps.cue
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ _#installRust: _#step & {
// NOTE: upstream does not tag releases, so this won't be updated by dependabot
uses: "dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d"
with: {
toolchain: *"stable" | string
components: *"clippy,rustfmt" | string
toolchain: *"stable" | string
components?: string
}
}

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ jobs:
uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d
with:
toolchain: nightly
components: clippy,rustfmt
- name: Build docs
env:
RUSTDOCFLAGS: --enable-index-page -Z unstable-options
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/preload-caches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ jobs:
uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d
with:
toolchain: stable
components: clippy,rustfmt
- name: Cache dependencies
uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f
with:
Expand All @@ -92,7 +91,6 @@ jobs:
uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d
with:
toolchain: ${{ steps.msrv.outputs.version }}
components: clippy,rustfmt
- name: Cache dependencies
uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f
with:
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ jobs:
uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d
with:
toolchain: stable
components: clippy,rustfmt
- name: Cache dependencies
uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f
with:
Expand All @@ -82,7 +81,7 @@ jobs:
uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d
with:
toolchain: stable
components: clippy,rustfmt
components: rustfmt
- name: Cache dependencies
uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f
with:
Expand All @@ -102,7 +101,7 @@ jobs:
uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d
with:
toolchain: stable
components: clippy,rustfmt
components: clippy
- name: Cache dependencies
uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f
with:
Expand Down Expand Up @@ -134,7 +133,6 @@ jobs:
uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d
with:
toolchain: stable
components: clippy,rustfmt
- name: Cache dependencies
uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f
with:
Expand Down Expand Up @@ -167,7 +165,6 @@ jobs:
uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d
with:
toolchain: ${{ steps.msrv.outputs.version }}
components: clippy,rustfmt
- name: Cache dependencies
uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f
with:
Expand Down

0 comments on commit 9c912b0

Please sign in to comment.