-
Notifications
You must be signed in to change notification settings - Fork 8
32 lines (27 loc) · 977 Bytes
/
check.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: '🚔'
on: [ push ]
jobs:
check:
if: startsWith(github.ref, 'refs/tags/v') == false
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
with:
nix_path: "nixpkgs=channel:nixos-23.11"
- name: 'Activate Nix store cache'
uses: actions/cache@v4
id: nix-cache
with:
path: "/tmp/nixcache"
key: "nix-store-${{ hashFiles(format('{0}/tools/build.sh', github.workspace)) }}"
- name: "Import Nix store cache"
if: "steps.nix-cache.outputs.cache-hit == 'true'"
run: nix-store --import < /tmp/nixcache
- run: |
make check
- name: "Export Nix store cache"
if: >
( github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' )
&& steps.nix-cache.outputs.cache-hit != 'true'
run: nix-store --export $(find /nix/store -maxdepth 1 -name '*-*') > /tmp/nixcache