mirror of
https://github.com/CatalaLang/catala.git
synced 2024-09-19 16:28:12 +03:00
nix build now uses cache
This commit is contained in:
parent
93aa6f0922
commit
7d50d89f7a
40
.github/workflows/run-builds.yml
vendored
40
.github/workflows/run-builds.yml
vendored
@ -1,16 +1,38 @@
|
|||||||
name: Builds
|
name: "nix CI"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [master]
|
branches: [master]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-nix-flake:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.4
|
- uses: actions/checkout@v3
|
||||||
- uses: cachix/install-nix-action@v15
|
- uses: cachix/install-nix-action@v18
|
||||||
- run: nix develop -c echo ok
|
with:
|
||||||
- run: nix build
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
- run: nix build .#clerk
|
- 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') }}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user