Skip to content

Commit

Permalink
ci: restore & save cache independently
Browse files Browse the repository at this point in the history
  • Loading branch information
jost-s committed Mar 9, 2024
1 parent 955ec29 commit 6aa43cb
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 36 deletions.
43 changes: 29 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,35 +31,50 @@ jobs:
with:
name: holochain-ci

- name: Cache fixture
uses: actions/cache@v4
- name: Install nix packages
run: nix develop -c $SHELL -c "holochain --version"

- name: Restore fixture
uses: actions/cache/restore@v4
env:
cache-name: fixture
with:
path: fixture/zomes/foo/target
key: ${{ matrix.os }}-build-${{ env.cache-name }}-${{ hashFiles('fixture/zomes/foo/Cargo.lock') }}

- name: Cache client build
uses: actions/cache@v4
if: always()
env:
cache-name: client
with:
path: target
key: ${{ matrix.os }}-cargo-${{ env.cache-name }}-${{ hashFiles('Cargo.lock') }}

- name: Install nix packages
run: nix develop -c $SHELL -c "holochain --version"

- name: Build fixture
run: nix develop -c $SHELL -c "./build-fixture.sh"

- name: Save fixture to cache
uses: actions/cache/save@v4
env:
cache-name: fixture
with:
path: fixture/zomes/foo/target
key: ${{ matrix.os }}-build-${{ env.cache-name }}-${{ hashFiles('fixture/zomes/foo/Cargo.lock') }}

- name: Clean up nix files to prevent insufficient disk space
run: nix-collect-garbage -d

- name: Restore client build
uses: actions/cache/restore@v4
env:
cache-name: client
with:
path: target
key: ${{ matrix.os }}-cargo-${{ env.cache-name }}-${{ hashFiles('Cargo.lock') }}

- name: Build client
run: cargo build -p holochain_client

- name: Save client build to cache
uses: actions/cache/save@v4
env:
cache-name: client
with:
path: target
key: ${{ matrix.os }}-cargo-${{ env.cache-name }}-${{ hashFiles('Cargo.lock') }}

- name: Lint
run: cargo clippy --all-features -- -D warnings

Expand Down
32 changes: 16 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6aa43cb

Please sign in to comment.