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