From 6aa43cbb70ba88ccbf55ec55aec5fc82be91ccca Mon Sep 17 00:00:00 2001 From: Jost Schulte Date: Fri, 8 Mar 2024 19:30:39 -0600 Subject: [PATCH] ci: restore & save cache independently --- .github/workflows/test.yml | 43 +++++++++++++++++++++++++------------- Cargo.lock | 32 ++++++++++++++-------------- flake.lock | 12 +++++------ 3 files changed, 51 insertions(+), 36 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 686f9d2..9a0ef66 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/Cargo.lock b/Cargo.lock index 5098a77..843f127 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -500,9 +500,9 @@ dependencies = [ [[package]] name = "backon" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c79c8ef183b8b663e8cb19cf92fb7d98c56739977bd47eae2de2717bd5de2c2c" +checksum = "c491fa80d69c03084223a4e73c378dd9f9a1e612eb54051213f88b2d5249b458" dependencies = [ "fastrand 2.0.1", "futures-core", @@ -660,9 +660,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.15.3" +version = "3.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" +checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" [[package]] name = "bytecheck" @@ -765,9 +765,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.89" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0ba8f7aaa012f30d5b2861462f6708eccd49c3c39863fe083a308035f63d723" +checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" dependencies = [ "jobserver", "libc", @@ -797,9 +797,9 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.34" +version = "0.4.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" +checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" dependencies = [ "android-tzdata", "iana-time-zone", @@ -854,9 +854,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.1" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" +checksum = "b230ab84b0ffdf890d5a10abdbc8b83ae1c4918275daea1ab8801f71536b2651" dependencies = [ "clap_builder", "clap_derive 4.5.0", @@ -864,9 +864,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.1" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", @@ -3260,7 +3260,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "321f0f839cd44a4686e9504b0a62b4d69a50b62072144c71c68f5873c167b8d9" dependencies = [ "ahash 0.8.11", - "clap 4.5.1", + "clap 4.5.2", "crossbeam-channel", "crossbeam-utils", "dashmap 5.5.3", @@ -3863,9 +3863,9 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2caa5afb8bf9f3a2652760ce7d4f62d21c4d5a423e68466fca30df82f2330164" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ "cfg-if 1.0.0", "windows-targets 0.52.4", @@ -7340,7 +7340,7 @@ version = "0.0.6-alpha" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95d19b62bad76105f28ae9aa5338a4d765546ffa6162223ad3204352a3afa2a2" dependencies = [ - "clap 4.5.1", + "clap 4.5.2", "dirs", "futures", "if-addrs 0.10.2", diff --git a/flake.lock b/flake.lock index 2bf0bee..cf39b8a 100644 --- a/flake.lock +++ b/flake.lock @@ -190,11 +190,11 @@ ] }, "locked": { - "lastModified": 1709914155, - "narHash": "sha256-ORQovDezgO9hcvyyvNu2TNmjrSWGqKhRAXuKbcXVYAg=", + "lastModified": 1709918081, + "narHash": "sha256-g51IqIcrFQAyLocRFXgQV7mskTqLC6yQypX3gQFKmG8=", "owner": "holochain", "repo": "holochain", - "rev": "9a8b50fdf8505094cf6dd94ce9ac0d333dfbb1dc", + "rev": "f76e144e3ae96156207b665c9cc686452e430017", "type": "github" }, "original": { @@ -386,11 +386,11 @@ }, "locked": { "dir": "versions/0_2_rc", - "lastModified": 1709914155, - "narHash": "sha256-ORQovDezgO9hcvyyvNu2TNmjrSWGqKhRAXuKbcXVYAg=", + "lastModified": 1709918081, + "narHash": "sha256-g51IqIcrFQAyLocRFXgQV7mskTqLC6yQypX3gQFKmG8=", "owner": "holochain", "repo": "holochain", - "rev": "9a8b50fdf8505094cf6dd94ce9ac0d333dfbb1dc", + "rev": "f76e144e3ae96156207b665c9cc686452e430017", "type": "github" }, "original": {