-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: let's free up some space and try merging all caches
- Loading branch information
Showing
1 changed file
with
6 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,17 +140,16 @@ jobs: | |
# NOTE: Regular users don't have permission to delete cache entries, which this job tries to do (see `purge: true` below). | ||
merge-nix-caches-linux: | ||
name: "Merge Nix caches (Linux)" | ||
# needs: [Test-Nix, Test-Pg-Nix, Test-Memory-Nix, Build-Static-Nix, Lint-Style] # Honestly, we don't really care of the order of cache merge job. Let's see how this works. | ||
needs: [Test-Nix, Test-Pg-Nix, Test-Memory-Nix, Build-Static-Nix, Lint-Style] # Honestly, we don't really care of the order of cache merge job. Let's see how this works. | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 1 # This hopefully prevents reserving cache entries by a single job, which would cause other jobs to fail to store "common" cache. | ||
matrix: | ||
cache-id: ['static-nix', 'test-pg', 'style', 'test-memory', 'loadtest'] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: nixbuild/nix-quick-install-action@v26 | ||
with: | ||
nix_version: '2.13.6' | ||
- uses: jlumbroso/[email protected] | ||
with: | ||
android: false # Free up 14-ish GB of disk space by removing Android SDK | ||
- name: Restore and cache Nix store | ||
uses: nix-community/cache-nix-action@v4 | ||
with: | ||
|
@@ -162,11 +161,11 @@ jobs: | |
# Specifying single per-job-type cache key effectively restores only 2 caches: the "common" cache and the cache for the current job type. | ||
# They are restored over one another, so resulting cache has all the nix store entries merged. | ||
extra-restore-keys: | | ||
cache-nix-${{ runner.os }}-id-${{ matrix.cache-id }}- | ||
cache-nix-${{ runner.os }}-id- | ||
purge: true | ||
# This purges current_job_type cache and the "common" cache older than 1 day, to save cache space. | ||
purge-keys: | | ||
cache-nix-${{ runner.os }}-id-${{ matrix.cache-id }}- | ||
cache-nix-${{ runner.os }}-id- | ||
cache-nix-${{ runner.os }}-common- | ||
purge-created-max-age: 86400 # 1 day | ||
# TODO: enable garbage collection | ||
|