From 605d797ab2518354d8cf89cdebfcf7d758c3a752 Mon Sep 17 00:00:00 2001 From: Nolan Le Date: Thu, 5 Dec 2024 10:35:36 +0200 Subject: [PATCH] chore(ci): update build, test and formatting --- .github/workflows/ci.yml | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8e2111..9a2312c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,30 +9,23 @@ on: - main jobs: - build: + test: + name: cargo test runs-on: ubuntu-latest - steps: - - name: Check out repository - uses: actions/checkout@v3 - - - name: Set up Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - run: cargo test --all-features - - name: Cache cargo registry - uses: actions/cache@v3 + # Check formatting with rustfmt + formatting: + name: cargo fmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + # Ensure rustfmt is installed and setup problem matcher + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo- - - - name: Build project - run: cargo build --workspace --all-targets - - - name: Run tests - run: cargo test --workspace --all-targets --all-features + components: rustfmt + - name: Rustfmt Check + uses: actions-rust-lang/rustfmt@v1