Skip to content

Commit c994e7b

Browse files
committed
ci: use cargo cache for integration test
1 parent f4419fb commit c994e7b

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

.github/workflows/rust.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,21 @@ jobs:
143143
# Everything inside that nix-shell will use a pinned version of
144144
# nixpkgs.
145145
nix_path: nixpkgs=channel:nixos-23.05
146-
- run: |
147-
cd integration-test
148-
nix-shell --run ./run.sh
146+
- name: Set up cargo cache
147+
uses: actions/cache@v3
148+
continue-on-error: false
149+
with:
150+
path: |
151+
~/.cargo/bin/
152+
~/.cargo/registry/index/
153+
~/.cargo/registry/cache/
154+
~/.cargo/git/db/
155+
integration-test/bins/target/
156+
# Hash over Cargo.toml and Cargo.lock, as this might be copied to
157+
# projects that do not have a Cargo.lock in their repository tree!
158+
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('integration-test/**/Cargo.toml', 'integration-test/**/Cargo.lock', 'integration-test/bins/rust-toolchain.toml') }}
159+
# Have all the "copying into Nix store" messages in a dedicated step for
160+
# better log visibility.
161+
- run: cd integration-test && nix-shell --run "echo OK" && cd ..
162+
# Now, run the actual test.
163+
- run: cd integration-test && nix-shell --run ./run.sh && cd ..

0 commit comments

Comments
 (0)