Skip to content

Commit 95749b5

Browse files
committed
ci: add Nix cache workflow
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I08a763b36c1794ea33bfb7b10467328f6a6a6964
1 parent 5012076 commit 95749b5

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/nix-cache.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build and Cache with Nix
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ "main" ]
7+
paths: [ 'watt/**.rs', 'xtask/*', 'build.rs', 'Cargo.toml', 'Cargo.lock', 'nix/package.nix', 'flake.nix', 'flake.lock' ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
populate-cache:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: "Checkout"
17+
uses: actions/checkout@v6
18+
19+
- uses: cachix/install-nix-action@v31
20+
with:
21+
nix_path: nixpkgs=channel:nixos-unstable
22+
23+
- uses: cachix/cachix-action@v16
24+
with:
25+
name: watt
26+
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
27+
28+
- name: "Build with Nix"
29+
run: nix build
30+

0 commit comments

Comments
 (0)