dotfiles/.gitea/workflows/build.yaml
Cyryl Płotnicki 3a460a9f58
Some checks failed
use nix / build (push) Failing after 2s
try nix cache action
2024-04-27 12:17:29 +01:00

40 lines
1.3 KiB
YAML

name: use nix
on: push
env:
DEV_SHELL_NAME: CI
jobs:
build:
runs-on: flakes-action
steps:
- uses: actions/checkout@v3
name: Checkout
- uses: nixbuild/nix-quick-install-action@v27
- name: Restore and cache Nix store
uses: https://github.com/nix-community/cache-nix-action@v5
with:
# restore and save a cache using this key
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix') }}
# if there's no cache hit, restore a cache by this prefix
restore-prefixes-first-match: nix-${{ runner.os }}-
# collect garbage until Nix store size (in bytes) is at most this number
# before trying to save a new cache
gc-max-store-size-linux: 1073741824
# do purge caches
purge: true
# purge all versions of the cache
purge-prefixes: cache-${{ runner.os }}-
# created more than this number of seconds ago relative to the start of the `Post Restore` phase
purge-created: 0
# except the version with the `primary-key`, if it exists
purge-primary-key: never
- name: Metadata
run: |
nix flake metadata
- name: Statix
run: |
nix develop -c statix check
- name: Flake check
run: |
nix flake check