* ci: try nix-community/cache-nix-action * ci: add cache-id param to setup-nix action * ci: tidy up cache keys for non-nix jobs * ci: merge-nix-caches-linux job * ci: merge caches other way around * ci: reduce number of caches Should prevent disk overflow * ci: change cache id prefix for merge * ci: comment out cache merging job * ci: revert cache id prefix * ci: setup-nix: use latest cache-nix-action Among others, makes action logs look more tidy (see https://github.com/nix-community/cache-nix-action/commit/17d19d3d8be918757589635bc1a6830be0b129d2) * ci: use test-pg cache key for loadtest
34 lines
962 B
YAML
34 lines
962 B
YAML
name: Setup Nix
|
|
|
|
description: Installs nix, sets up cachix and installs a subset of tooling.
|
|
|
|
inputs:
|
|
authToken:
|
|
description: Token to pass to cachix
|
|
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
|
|
uses: nix-community/cache-nix-action@v4.0.3
|
|
with:
|
|
key: cache-nix-${{ runner.os }}-id-${{ inputs.cache-id }}-${{ hashFiles('nix/**/*.nix') }}
|
|
restore-keys: |
|
|
cache-nix-${{ runner.os }}-common-
|
|
restore-key-hit: true
|
|
- uses: cachix/cachix-action@v12
|
|
with:
|
|
name: postgrest
|
|
authToken: ${{ inputs.authToken }}
|
|
- if: ${{ inputs.tools }}
|
|
run: nix-env -f default.nix -iA ${{ inputs.tools }}
|
|
shell: bash
|