File tree Expand file tree Collapse file tree 4 files changed +78
-0
lines changed
Expand file tree Collapse file tree 4 files changed +78
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Nix Flake actions
2+
3+ on :
4+ pull_request :
5+ push :
6+ branches :
7+ - master
8+
9+ jobs :
10+ nix-matrix :
11+ runs-on : ubuntu-latest
12+ outputs :
13+ matrix : ${{ steps.set-matrix.outputs.matrix }}
14+ steps :
15+ - uses : actions/checkout@v4
16+ - uses : DeterminateSystems/nix-installer-action@main
17+ with :
18+ extra-conf : |
19+ experimental-features = nix-command flakes pipe-operators
20+ - uses : DeterminateSystems/magic-nix-cache-action@main
21+ - id : set-matrix
22+ name : Generate Nix Matrix
23+ run : |
24+ set -Eeu
25+ matrix="$(nix eval --json '.#githubActions.matrix')"
26+ echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
27+
28+ nix-build :
29+ name : ${{ matrix.name }} (${{ matrix.system }})
30+ needs : nix-matrix
31+ runs-on : ${{ matrix.os }}
32+ strategy :
33+ matrix : ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
34+ steps :
35+ - uses : actions/checkout@v4
36+ - uses : DeterminateSystems/nix-installer-action@main
37+ with :
38+ extra-conf : |
39+ experimental-features = nix-command flakes pipe-operators
40+ - uses : DeterminateSystems/magic-nix-cache-action@main
41+ - run : nix build -L '.#${{ matrix.attr }}'
Original file line number Diff line number Diff line change 1+ {
2+ inputs ,
3+ lib ,
4+ config ,
5+ ...
6+ } :
7+ {
8+ flake . githubActions = inputs . nix-github-actions . lib . mkGithubMatrix {
9+ checks = lib . getAttrs [ "x86_64-linux" ] config . flake . packages ;
10+ } ;
11+ }
Original file line number Diff line number Diff line change 4646 url = "github:nix-community/nixos-generators" ;
4747 inputs . nixpkgs . follows = "nixpkgs" ;
4848 } ;
49+
50+ nix-github-actions = {
51+ url = "github:nix-community/nix-github-actions" ;
52+ inputs . nixpkgs . follows = "nixpkgs" ;
53+ } ;
4954 } ;
5055
5156 outputs =
You can’t perform that action at this time.
0 commit comments