2023-02-24 21:38:50 +03:00
|
|
|
name: "nix CI"
|
2022-02-03 21:45:52 +03:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [master]
|
2022-02-03 21:47:42 +03:00
|
|
|
workflow_dispatch:
|
2022-02-03 21:45:52 +03:00
|
|
|
jobs:
|
2023-02-24 21:38:50 +03:00
|
|
|
build:
|
2022-02-03 21:45:52 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-02-24 21:38:50 +03:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: cachix/install-nix-action@v18
|
|
|
|
with:
|
|
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
|
|
|
- id: cache-restore
|
|
|
|
uses: actions/cache/restore@v3
|
|
|
|
with:
|
|
|
|
path: nix-store.nar
|
|
|
|
key: nix-store-nar-${{ hashFiles('flake.lock') }}
|
|
|
|
- if: steps.cache-restore.outputs.cache-hit == 'true'
|
|
|
|
run: |
|
|
|
|
nix-store --import < nix-store.nar
|
|
|
|
rm nix-store.nar
|
|
|
|
|
|
|
|
- run: nix develop
|
|
|
|
- run: nix build
|
|
|
|
- run: nix build .#clerk
|
|
|
|
|
|
|
|
- name: dump store
|
|
|
|
if: steps.cache-restore.outputs.cache-hit == 'false'
|
|
|
|
run: nix-store --export $(nix-store -qR $(nix print-dev-env --json | jq .variables.prefix.value -r)) > nix-store.nar
|
|
|
|
- name: save current cache
|
|
|
|
if: steps.cache-restore.outputs.cache-hit == 'false'
|
|
|
|
uses: actions/cache/save@v3
|
|
|
|
id: cache
|
|
|
|
with:
|
|
|
|
path: nix-store.nar
|
|
|
|
key: nix-store-nar-${{ hashFiles('flake.lock') }}
|
|
|
|
|