File tree Expand file tree Collapse file tree 5 files changed +89
-0
lines changed Expand file tree Collapse file tree 5 files changed +89
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Nix Flake Actions
2+ on :
3+ pull_request :
4+ workflow_dispatch :
5+ push :
6+ branches :
7+ - master
8+ - main
9+
10+ jobs :
11+ nix-matrix :
12+ runs-on : ubuntu-latest
13+ outputs :
14+ matrix : ${{ steps.set-matrix.outputs.matrix }}
15+ steps :
16+ - uses : actions/checkout@v4
17+ - uses : cachix/install-nix-action@v27
18+ - id : set-matrix
19+ name : Generate Nix Matrix
20+ run : |
21+ set -Eeu
22+ matrix="$(nix eval --json '.#githubActions.matrix')"
23+ echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
24+
25+ nix-flake-checks :
26+ needs : nix-matrix
27+ runs-on : ${{ matrix.os }}
28+ strategy :
29+ matrix : ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
30+ steps :
31+ - uses : actions/checkout@v4
32+ - uses : cachix/install-nix-action@v27
33+ - uses : cachix/cachix-action@v15
34+ with :
35+ name : jaen-robotnix
36+ authToken : " ${{ secrets.CACHIX_AUTH_TOKEN }}"
37+ - run : nix build -L ".#${{ matrix.attr }}"
38+
39+ nix-flake-check-template :
40+ runs-on : ubuntu-latest
41+ steps :
42+ - uses : actions/checkout@v4
43+ - uses : cachix/install-nix-action@v27
44+ - uses : cachix/cachix-action@v15
45+ with :
46+ name : jaen-robotnix
47+ authToken : " ${{ secrets.CACHIX_AUTH_TOKEN }}"
48+ - name : " Check the robotnix flake"
49+ run : |
50+ # Don't run checks here, the `nix-flake-checks` job takes care of it
51+ nix flake check --no-build
52+ - name : " Check the templated robotnix flake"
53+ run : |
54+ export ORIG_DIR=$PWD
55+ cd $(mktemp -d)
56+
57+ nix flake init -t $ORIG_DIR
58+ nix flake check --override-input robotnix $ORIG_DIR
Original file line number Diff line number Diff line change 1+ line_ending : " lf"
2+ formatter :
3+ indent : 2
4+ retain_line_breaks_single : true
5+ scan_folded_as_literal : true
Original file line number Diff line number Diff line change 1111
1212 treefmt-nix . url = "github:numtide/treefmt-nix" ;
1313 treefmt-nix . inputs . nixpkgs . follows = "nixpkgs-unstable" ;
14+
15+ nix-github-actions . url = "github:nix-community/nix-github-actions" ;
16+ nix-github-actions . inputs . nixpkgs . follows = "nixpkgs" ;
1417 } ;
1518
1619 outputs = args : import ./flake/outputs.nix args ;
Original file line number Diff line number Diff line change 55 androidPkgs ,
66 flake-compat ,
77 treefmt-nix ,
8+ nix-github-actions ,
89 ...
910} @inputs :
1011let
9091 } ;
9192 } ;
9293
94+ githubActions = nix-github-actions . lib . mkGithubMatrix { inherit ( self ) checks ; } ;
9395}
You can’t perform that action at this time.
0 commit comments