From 2d3a282e5a25c7b4a74ed1bcb914676b8838e04a Mon Sep 17 00:00:00 2001 From: Francesco Forcher Date: Sun, 28 Jul 2024 19:48:50 +0200 Subject: [PATCH] Add CI cache action --- .github/workflows/rust.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 921d27a..ace9a23 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -37,6 +37,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + + - name: Setup Rust toolchain and cache + uses: actions-rust-lang/setup-rust-toolchain@v1 + - name: Check with clippy run: cargo clippy -- --deny warnings @@ -44,14 +48,22 @@ jobs: name: cargo fmt runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Check rust formatting - run: cargo fmt --all -- --check + - uses: actions/checkout@v4 + + - name: Setup Rust toolchain and cache + uses: actions-rust-lang/setup-rust-toolchain@v1 + + - name: Check rust formatting + run: cargo fmt --all -- --check test: name: cargo test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Run tests - run: cargo test --all-features + - uses: actions/checkout@v4 + + - name: Setup Rust toolchain and cache + uses: actions-rust-lang/setup-rust-toolchain@v1 + + - name: Run tests + run: cargo test --all-features