@@ -11,10 +11,127 @@ jobs:
1111 steps :
1212 - uses : actions/checkout@v3
1313 with :
14- # Nix Flakes doesn't work on shallow clones
15- fetch-depth : 0
14+ # Nix Flakes doesn't work on shallow clones
15+ fetch-depth : 0
1616 - uses : cachix/install-nix-action@v17
1717 - name : List flake structure
1818 run : nix flake show
1919 - name : Run unit tests (flake)
2020 run : nix build -L
21+ check :
22+ runs-on : ubuntu-latest
23+ steps :
24+ - uses : actions/checkout@v3
25+ with :
26+ fetch-depth : 0
27+ - uses : cachix/install-nix-action@v17
28+ - name : Run flake checks
29+ run : nix flake check --no-build --keep-going
30+ introspect :
31+ runs-on : ubuntu-latest
32+ outputs :
33+ nixpkgs-rev : ${{ steps.nixpkgs-rev.outputs.rev }}
34+ nixos-rev : ${{ steps.nixos-rev.outputs.rev }}
35+ formats : ${{ steps.list-formats.outputs.formats }}
36+ steps :
37+ - uses : actions/checkout@v3
38+ with :
39+ fetch-depth : 0
40+ - uses : cachix/install-nix-action@v17
41+ - name : Get nixpkgs flake input rev
42+ id : nixpkgs-rev
43+ uses : ./.github/actions/get-flake-input-rev
44+ with :
45+ flake-input-name : nixpkgs
46+ - name : Get nixos flake input rev
47+ id : nixos-rev
48+ uses : ./.github/actions/get-flake-input-rev
49+ with :
50+ flake-input-name : nixos
51+ - name : List available formats
52+ id : list-formats
53+ if : github.event_name == 'push' && github.ref == 'refs/heads/master'
54+ uses : ./.github/actions/list-formats
55+ default-formats :
56+ strategy :
57+ matrix :
58+ format :
59+ - amazon
60+ - docker
61+ - iso
62+ - kexec-bundle
63+ nixpkgs-name :
64+ - nixpkgs
65+ - nixos
66+ include :
67+ - nixpkgs-name : nixpkgs
68+ nixpkgs : ' https://github.com/nixos/nixpkgs/archive/${{ needs.introspect.outputs.nixpkgs-rev }}.tar.gz'
69+ - nixpkgs-name : nixos
70+ nixpkgs : ' https://github.com/nixos/nixpkgs/archive/${{ needs.introspect.outputs.nixos-rev }}.tar.gz'
71+ - format : kexec-bundle
72+ force-build : yes
73+ runs-on : ubuntu-latest
74+ needs : [ 'check', 'introspect' ]
75+ steps :
76+ - uses : actions/checkout@v3
77+ with :
78+ fetch-depth : 0
79+ - uses : cachix/install-nix-action@v17
80+ with :
81+ # kvm required for a number of formats; big-parallel required for
82+ # proxmox and possibly others.
83+ extra_nix_config : |
84+ system-features = big-parallel kvm
85+ - name : Build the "${{ matrix.format }}" format
86+ id : generate
87+ uses : ./.github/actions/generate-format
88+ with :
89+ format : ${{ matrix.format }}
90+ system : ${{ matrix.system }}
91+ nixpkgs-name : ${{ matrix.nixpkgs-name }}
92+ nixpkgs : ${{ matrix.nixpkgs }}
93+ force-build : ${{ matrix.force-build }}
94+ all-formats :
95+ if : github.event_name == 'push' && github.ref == 'refs/heads/master'
96+ strategy :
97+ matrix :
98+ format : ${{ needs.introspect.outputs.formats && fromJSON(needs.introspect.outputs.formats) }}
99+ nixpkgs-name :
100+ - nixpkgs
101+ - nixos
102+ include :
103+ - nixpkgs-name : nixpkgs
104+ nixpkgs : ' https://github.com/nixos/nixpkgs/archive/${{ needs.introspect.outputs.nixpkgs-rev }}.tar.gz'
105+ - nixpkgs-name : nixos
106+ nixpkgs : ' https://github.com/nixos/nixpkgs/archive/${{ needs.introspect.outputs.nixos-rev }}.tar.gz'
107+ - format : kexec-bundle
108+ force-build : yes
109+ - format : sd-aarch64-installer
110+ system : aarch64-linux
111+ - format : sd-aarch64
112+ system : aarch64-linux
113+ runs-on : ubuntu-latest
114+ needs : [ 'check', 'introspect' ]
115+ steps :
116+ - uses : actions/checkout@v3
117+ with :
118+ fetch-depth : 0
119+ # set up qemu if we are targeting a non-native system
120+ - uses : docker/setup-qemu-action@v2
121+ if : ${{ matrix.system }}
122+ - uses : cachix/install-nix-action@v17
123+ with :
124+ # kvm required for a number of formats; big-parallel required for
125+ # proxmox and possibly others.
126+ extra_nix_config : |
127+ system-features = big-parallel kvm
128+ extra-platforms = ${{ matrix.system }}
129+ - name : Build the "${{ matrix.format }}" format
130+ id : generate
131+ uses : ./.github/actions/generate-format
132+ with :
133+ format : ${{ matrix.format }}
134+ system : ${{ matrix.system }}
135+ nixpkgs-name : ${{ matrix.nixpkgs-name }}
136+ nixpkgs : ${{ matrix.nixpkgs }}
137+ force-build : ${{ matrix.force-build }}
0 commit comments