Skip to content

Commit

Permalink
upd: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
deemp committed Dec 11, 2023
1 parent 496447f commit 3b3075d
Showing 1 changed file with 16 additions and 21 deletions.
37 changes: 16 additions & 21 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,20 +122,23 @@ jobs:
- name: Rebase
run: git pull --rebase

- uses: nixbuild/nix-quick-install-action@v25
- uses: nixbuild/nix-quick-install-action@v26
with:
nix_conf: |
substituters = https://cache.nixos.org/ https://nix-community.cachix.org
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
keep-outputs = true
- name: Restore and cache Nix store - ${{ matrix.id }}
uses: ./.
with:
# save a new cache every time ci file changes
key: similar-cache-${{ matrix.os }}-id-${{ matrix.id }}-${{ hashFiles('.github/workflows/ci.yaml') }}
restore-keys: |
similar-cache-${{ matrix.os }}-common-
restore-key-hit: true
primary-key: similar-cache-${{ matrix.os }}-individual-${{ matrix.id }}-${{ hashFiles('.github/workflows/ci.yaml') }}
prefixes-first-match: similar-cache-${{ matrix.os }}-common-

# remove own old versions
purge: true
purge-overwrite: always

# Merge similar individual `id` caches
# Purge individual caches and old `common` caches
Expand Down Expand Up @@ -171,15 +174,14 @@ jobs:
- name: Save Nix store
uses: ./.
with:
key: similar-cache-${{ matrix.os }}-common-${{ hashFiles('.github/workflows/ci.yaml') }}
extra-restore-keys: |
similar-cache-${{ matrix.os }}-id-
primary-key: similar-cache-${{ matrix.os }}-common-${{ hashFiles('.github/workflows/ci.yaml') }}
prefixes-all-matches: similar-cache-${{ matrix.os }}-individual-

purge: true
purge-keys: |
similar-cache-${{ matrix.os }}-id-
purge-prefixes: |
similar-cache-${{ matrix.os }}-individual-
similar-cache-${{ matrix.os }}-common-
purge-created-max-age: 0
purge-created: 0

compare-run-times:
name: Job with caching
Expand Down Expand Up @@ -212,27 +214,20 @@ jobs:
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
keep-outputs = true
# -------- THIS ACTION --------
- name: Restore and cache Nix store
if: ${{ matrix.do-cache }}
uses: ./.
with:
# save a new cache every time ci file changes
key: cache-${{ matrix.os }}-${{ hashFiles('.github/workflows/ci.yaml') }}
restore-keys: |
cache-${{ matrix.os }}-
restore-prefixes-first-match: cache-${{ matrix.os }}-

gc-linux: true
gc-max-store-size-linux: 8000000000
gc-macos: true
gc-max-store-size-macos: 8000000000

purge: true
purge-keys: cache-${{ matrix.os }}-
purge-created: true
purge-created-max-age: 172800

# -------- THIS ACTION --------
purge-prefixes: cache-${{ matrix.os }}-
purge-created: 172800

# Uncomment to debug this job
# - name: Setup tmate session
Expand Down

0 comments on commit 3b3075d

Please sign in to comment.