From d32d6cf9f5d8349e650eef344a2494a3f3c9786e Mon Sep 17 00:00:00 2001 From: Claas Augner <495429+caugner@users.noreply.github.com> Date: Thu, 29 Feb 2024 23:04:42 +0100 Subject: [PATCH] chore(workflows): cache build artifacts (#420) * chore(workflows): use sccache * chore(workflows): cache cargo registry --- .github/workflows/build-and-test.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 36edf37d..2f0f392c 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -24,6 +24,10 @@ jobs: - 5432:5432 options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" + steps: - uses: actions/checkout@v2 - name: Install Rust @@ -32,6 +36,16 @@ jobs: toolchain: 1.76.0 override: true components: rustfmt, clippy + - name: Cache Cargo registry + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo- + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.4 - name: FMT run: cargo fmt --all -- --check - name: Clippy