diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 33ec4eb..9278413 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -7,39 +7,42 @@ on: branches: [master] jobs: + # Use MSRV for the build job build: - runs-on: ubuntu-latest + name: Build + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v2 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: 1.56 + - run: cargo build + + # Use stable for other jobs + test: + name: Run tests + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v2 + - uses: dtolnay/rust-toolchain@stable + - run: cargo test + + check-fmt: + name: Check formatting + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v2 + - uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + - run: cargo fmt -- --check + clippy: + name: Catch common mistakes + runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v2 - # Use MSRV for the build job - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.56 - default: true - profile: minimal - - name: Build - uses: actions-rs/cargo@v1 - with: - command: build - # Use stable for other jobs - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - default: true - profile: minimal - components: rustfmt, clippy - - name: Run tests - uses: actions-rs/cargo@v1 - with: - command: test - - name: Check formatting - uses: actions-rs/cargo@v1 - with: - command: fmt - args: -- --check - - name: Catch common mistakes - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --all-targets -- -D warnings + - uses: actions/checkout@v2 + - uses: dtolnay/rust-toolchain@stable + with: + components: clippy + - run: cargo clippy --all-targets -- -D warnings