From 30d3898b5b2b79698480ad035347df9822af42f5 Mon Sep 17 00:00:00 2001 From: KtorZ Date: Wed, 17 Jul 2024 12:56:41 +0200 Subject: [PATCH] Add Rust cache to continuous integration workflow. --- .github/workflows/tests.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 31db2fb4..3b65df6b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,6 +14,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + with: + save-if: ${{ github.ref == 'refs/heads/main' }} + key: ${{ runner.os }}-cache-acceptance-v${{ inputs.cache-version }} - name: Run examples run: | cargo run -r -- check examples/hello_world @@ -30,6 +35,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + with: + save-if: ${{ github.ref == 'refs/heads/main' }} + key: ${{ runner.os }}-cache-unit-v${{ inputs.cache-version }} - name: Run unit tests run: cargo test --verbose --workspace @@ -37,6 +47,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + with: + save-if: ${{ github.ref == 'refs/heads/main' }} + key: ${{ runner.os }}-cache-unit-v${{ inputs.cache-version }} - name: Format run: cargo fmt --all -- --check - name: Clippy