File tree Expand file tree Collapse file tree 4 files changed +72
-0
lines changed
Expand file tree Collapse file tree 4 files changed +72
-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+ - uses : DeterminateSystems/magic-nix-cache-action@main
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-build :
26+ name : ${{ matrix.name }} (${{ matrix.system }})
27+ needs : nix-matrix
28+ runs-on : ${{ matrix.os }}
29+ strategy :
30+ matrix : ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
31+ steps :
32+ - uses : actions/checkout@v4
33+ - uses : DeterminateSystems/nix-installer-action@main
34+ - uses : DeterminateSystems/magic-nix-cache-action@main
35+ - 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