From a6300e64983a4c9eef864fde4cb32b5b988ff3e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DOUIN?= Date: Tue, 17 Sep 2024 07:59:23 +0200 Subject: [PATCH] cache cargo home --- .github/workflows/test.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 720ddf5..bb6e762 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,6 +6,8 @@ on: jobs: test: runs-on: ${{ matrix.os }} + env: + CARGO_HOME: ~/.cargo strategy: fail-fast: false matrix: @@ -29,11 +31,22 @@ jobs: nix_path: nixpkgs=channel:nixos-24.05 enable_kvm: true extra_nix_config: "experimental-features = nix-command flakes" - - uses: cachix/cachix-action@v15 + - name: Restore Nix store + uses: cachix/cachix-action@v15 with: name: soywod authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' extraPullNames: nix-community + - name: Restore Cargo home + uses: actions/cache/restore@v4 + id: cache-cargo-home + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ - name: Build release run: | nix run -L .#${{ matrix.target }} -- --version @@ -44,3 +57,13 @@ jobs: path: | result/himalaya.tgz result/himalaya.zip + - name: Save Cargo home + id: cache-cargo-home + uses: actions/cache/save@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + key: ${{ steps.cache-cargo-home.outputs.cache-primary-key }}