From bca9de11d9abbccfd679815f719b01fdc57d4ff1 Mon Sep 17 00:00:00 2001 From: Justin Bennett Date: Tue, 18 Feb 2025 23:52:06 -0500 Subject: [PATCH] Cache rust dependecies (#136) --- .github/workflows/rust-binary.yml | 11 +++++++++++ .github/workflows/verify.yml | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/.github/workflows/rust-binary.yml b/.github/workflows/rust-binary.yml index 4636436..1f21f90 100644 --- a/.github/workflows/rust-binary.yml +++ b/.github/workflows/rust-binary.yml @@ -43,6 +43,17 @@ jobs: cache_key_prefix: mise-${{ hashFiles('mise.toml') }}-${{ matrix.target }} experimental: true + - name: Setup Rust cache + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + shared-key: "binary-${{ matrix.target }}" + workspaces: "." + cache-directories: | + ~/.cargo/registry/index + ~/.cargo/registry/cache + ~/.cargo/git/db + - run: mise x -- rustup target add ${{ matrix.target }} - run: mise run ci:install-deps diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 9561b7a..970cdd6 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -13,6 +13,12 @@ jobs: cache_key_prefix: mise-{{hashFiles('mise.toml')}} experimental: true + - name: Setup Rust cache + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + shared-key: "lint" + - name: Lint run: mise lint @@ -38,6 +44,12 @@ jobs: cache_key_prefix: mise-{{hashFiles('mise.toml')}} experimental: true + - name: Setup Rust cache + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + shared-key: "codegen" + - name: Run codegen run: mise run gen