Skip to content

Commit

Permalink
chore(ci): install all Rust versions at once, clean up caching
Browse files Browse the repository at this point in the history
  • Loading branch information
clechasseur committed Sep 25, 2024
1 parent 9050ce1 commit 7f12faa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ jobs:
with:
toolchain: stable
components: clippy
cache: false

- name: Rust Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
with:
prefix-key: v1-rust
key: all-features-${{ matrix.all-features }}
cache-on-failure: true

- name: Run clippy
uses: clechasseur/rs-clippy-check@a2a93bdcf05de7909aabd62eca762179ad3dbe50 # v3.0.5
Expand Down Expand Up @@ -63,30 +71,23 @@ jobs:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Install Rust nightly toolchain
if: ${{ matrix.toolchain != 'nightly' }}
- name: Install Rust nightly and ${{ matrix.toolchain }}
uses: actions-rust-lang/setup-rust-toolchain@4d1965c9142484e48d40c19de54b5cba84953a06 # v1.10.0
with:
toolchain: nightly
cache: false

- name: Install Rust toolchain ${{ matrix.toolchain }}
uses: actions-rust-lang/setup-rust-toolchain@4d1965c9142484e48d40c19de54b5cba84953a06 # v1.10.0
with:
toolchain: ${{ matrix.toolchain }}
toolchain: nightly,${{ matrix.toolchain }}
cache: false

- name: Rust Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
with:
prefix-key: v6-rust
prefix-key: v7-rust
key: all-features-${{ matrix.all-features }}-msrv-pins-files-${{ hashFiles('**/msrv-pins.toml') }}
cache-on-failure: true

- name: Install required tools
uses: taiki-e/install-action@ae888b48c8777229768754549e5463ba726cb1b3 # v2.44.1
with:
tool: just,cargo-hack,cargo-minimal-versions,cargo-msrv-prep
tool: just,cargo-hack,cargo-minimal-versions,cargo-msrv,cargo-msrv-prep
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -121,7 +122,7 @@ jobs:
if: ${{ matrix.ignore-lock }}
run: rm Cargo.lock

- name: Install Rust toolchain ${{ matrix.toolchain }}
- name: Install Rust ${{ matrix.toolchain }}
uses: actions-rust-lang/setup-rust-toolchain@4d1965c9142484e48d40c19de54b5cba84953a06 # v1.10.0
with:
toolchain: ${{ matrix.toolchain }}
Expand Down Expand Up @@ -213,7 +214,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Install Rust toolchain ${{ matrix.toolchain }}
- name: Install Rust ${{ matrix.toolchain }}
uses: actions-rust-lang/setup-rust-toolchain@4d1965c9142484e48d40c19de54b5cba84953a06 # v1.10.0
with:
toolchain: ${{ matrix.toolchain }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Install Rust toolchain ${{ matrix.toolchain }}
- name: Install Rust ${{ matrix.toolchain }}
uses: actions-rust-lang/setup-rust-toolchain@4d1965c9142484e48d40c19de54b5cba84953a06 # v1.10.0
with:
toolchain: ${{ matrix.toolchain }}
Expand Down

0 comments on commit 7f12faa

Please sign in to comment.