Skip to content

Commit

Permalink
ci(test): only cache store changed files
Browse files Browse the repository at this point in the history
  • Loading branch information
klarkc committed Jan 3, 2024
1 parent 7f41647 commit 4b78e5b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,15 @@ jobs:
ssh-private-key: ${{ secrets.BUILDER_TOKEN }}
- uses: gacts/run-and-post-run@v1
with:
run: nix -v flake check -L --show-trace
run: |
curl https://raw.githubusercontent.com/cachix/cachix-action/master/dist/main/list-nix-store.sh --output ./.github/workflows/list-nix-store.sh
chmod +x ./.github/workflows/list-nix-store.sh
./.github/workflows/list-nix-store.sh > /tmp/store
nix -v flake check -L --show-trace
post: |
./.github/workflows/list-nix-store.sh > /tmp/store-new
comm -13 <(sort /tmp/store) <(./.github/workflows/list-nix-store.sh) > /tmp/store-new
mkdir -p ~/.ssh/ && touch ~/.ssh/known_hosts
cp .github/workflows/known_hosts ~/.ssh/known_hosts
nix -v copy -s --all --to ssh://[email protected]
(cat /tmp/store-new | nix -v copy -s --stdin --to ssh://[email protected]) || EXIT_CODE=$?
echo $EXIT_CODE

0 comments on commit 4b78e5b

Please sign in to comment.