From 41ee6eb47e2ab37fff50aa9796bc7eec69b9e6fc Mon Sep 17 00:00:00 2001 From: Akseli Lukkarila Date: Thu, 8 Feb 2024 14:41:52 +0200 Subject: [PATCH] run rust build and lint in separate jobs --- .github/workflows/rust.yml | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 301325c..8d29187 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -24,7 +24,7 @@ env: CARGO_TERM_COLOR: always jobs: - rust: + build: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] @@ -51,10 +51,31 @@ jobs: key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Build - run: cargo build --verbose + run: cargo build - name: Run tests - run: cargo test + run: cargo test --no-fail-fast + + lint: + runs-on: ubuntu-latest + steps: + - name: Check out source repository + uses: actions/checkout@v4 + + - name: Set up Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Check formatting run: cargo fmt --check --verbose