Skip to content

Commit

Permalink
CI: Use MSRV for tests & lints
Browse files Browse the repository at this point in the history
Installing latest stable can make the CI fail when Clippy is updated
with new lints for example. We should pin the toolchain versions to the
MSRV in the `test` and `lints` checks to avoid spurious failures.
  • Loading branch information
the-mikedavis committed Dec 3, 2024
1 parent c033d2e commit 305f34f
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ on:
push:
branches:
- master

env:
MSRV: "1.70"
jobs:
check-msrv:
check:
name: Check
strategy:
matrix:
toolchain:
- "1.70"
- MSRV
- stable
runs-on: ubuntu-latest
steps:
Expand All @@ -27,7 +28,7 @@ jobs:
- name: Install toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain}}
toolchain: ${{ matrix.toolchain == 'MSRV' && env.MSRV || 'stable' }}

- uses: Swatinem/rust-cache@v2

Expand All @@ -46,8 +47,10 @@ jobs:
- name: Remove the rust-toolchain.toml
run: rm rust-toolchain.toml

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install MSRV toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: "${{ env.MSRV }}"

- uses: Swatinem/rust-cache@v2

Expand All @@ -67,9 +70,10 @@ jobs:
- name: Remove the rust-toolchain.toml
run: rm rust-toolchain.toml

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install MSRV toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: "${{ env.MSRV }}"
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v2
Expand Down

0 comments on commit 305f34f

Please sign in to comment.