-
-
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: Share cache between loadtest and other tests
This puts all those development tools that depend on the dynamically linked postgrestPackage into a single cache group. Notably this now includes the loadtest, but does not include the style/lint job anymore. This also improves the creation of cache keys and their restore prefixes. The cache key now depends on default.nix and shell.nix in the root folder and all .patch files in the nix folder. Those may change the output of our nix derivations, so must be included. At the same time, there is no reason to include the actions/setup-nix folder. This would only lead to new caches being created every time we update one of the depndent actions in this file. Finally, restoring caches from a different toolset makes zero sense, so we remove that again. There is no point in having the style job fall back to the static cache for example.
- Loading branch information
1 parent
65c5c99
commit 742268e
Showing
2 changed files
with
23 additions
and
21 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 |
---|---|---|
|
@@ -5,26 +5,24 @@ description: Installs nix, sets up cachix and installs a subset of tooling. | |
inputs: | ||
authToken: | ||
description: Token to pass to cachix | ||
cache: | ||
description: Cache id to use for cache-nix-action | ||
tools: | ||
description: Tools to install with nix-env -iA <tools> | ||
cache-id: | ||
description: Cache id to use for cache-nix-action | ||
default: "default" | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: nixbuild/nix-quick-install-action@v26 | ||
with: | ||
nix_version: '2.13.6' | ||
- name: Restore and cache Nix store | ||
- name: Restore and save /nix/store cache | ||
if: ${{ inputs.cache }} | ||
uses: nix-community/[email protected] | ||
with: | ||
key: cache-nix-${{ runner.os }}-id-${{ inputs.cache-id }}-${{ hashFiles('nix/**/*.nix', '.github/actions/setup-nix/*') }} | ||
key: cache-nix-${{ runner.os }}-${{ inputs.cache }}-${{ hashFiles('**/*.nix', 'nix/**/*.patch') }} | ||
restore-keys: | | ||
cache-nix-${{ runner.os }}-id-${{ inputs.cache-id }}- | ||
cache-nix-${{ runner.os }}-id-common- | ||
cache-nix-${{ runner.os }}- | ||
cache-nix-${{ runner.os }}-${{ inputs.cache }}- | ||
- uses: cachix/cachix-action@v14 | ||
with: | ||
name: postgrest | ||
|
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