-
Notifications
You must be signed in to change notification settings - Fork 6
192 lines (187 loc) · 6.31 KB
/
ci.yaml
File metadata and controls
192 lines (187 loc) · 6.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
name: ci
on:
push:
branches:
- master
- try
pull_request:
permissions: {}
env:
flake: github:${{ github.repository }}/${{ github.sha }}
nix-conf: |-
accept-flake-config = true
always-allow-substitutes = true
builders-use-substitutes = true
max-jobs = auto
nix-fast-build-args: --no-nom --skip-cached --retries=3 --option accept-flake-config true
jobs:
flake-check:
name: flake check (${{ matrix.systems.platform }})
runs-on: ${{ matrix.systems.os }}
strategy:
matrix:
systems:
- os: ubuntu-24.04
platform: x86_64-linux
- os: ubuntu-22.04-arm
platform: aarch64-linux
- os: macos-15
platform: aarch64-darwin
steps:
- uses: nixbuild/nix-quick-install-action@v34
with:
nix_conf: ${{ env.nix-conf }}
- uses: cachix/cachix-action@v16
with:
name: bbigras-nix-config
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: nix-community
- name: nix-flake-check
run: nix flake check '${{ env.flake }}' --impure --option allow-import-from-derivation true
flake-show:
name: flake show (${{ matrix.systems.platform }})
runs-on: ${{ matrix.systems.os }}
strategy:
matrix:
systems:
- os: ubuntu-24.04
platform: x86_64-linux
- os: ubuntu-22.04-arm
platform: aarch64-linux
- os: macos-15
platform: aarch64-darwin
steps:
- uses: nixbuild/nix-quick-install-action@v34
with:
nix_conf: ${{ env.nix-conf }}
- uses: cachix/cachix-action@v16
with:
name: bbigras-nix-config
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: nix-community
- name: nix-flake-show
run: nix flake show '${{ env.flake }}' --impure --option allow-import-from-derivation true
get-attrs:
runs-on: ubuntu-24.04
outputs:
build: ${{ steps.get-attrs.outputs.build }}
eval: ${{ steps.get-attrs.outputs.eval }}
darwin-hosts: ${{ steps.get-attrs.outputs.darwin-hosts }}
steps:
- uses: actions/checkout@v5
with:
sparse-checkout: |
nix/hosts.nix
.github/workflows/get-attrs.py
- uses: nixbuild/nix-quick-install-action@v34
- id: get-attrs
run: ./.github/workflows/get-attrs.py
eval:
name: eval ${{ matrix.attrs.name }} (${{ matrix.attrs.hostPlatform }})
if: ${{ fromJson(needs.get-attrs.outputs.eval)[0] != null }}
runs-on: ${{ matrix.attrs.runsOn }}
needs: [get-attrs]
strategy:
fail-fast: false
matrix:
attrs: ${{ fromJson(needs.get-attrs.outputs.eval) }}
env:
system: ${{ matrix.attrs.hostPlatform }}
steps:
- uses: nixbuild/nix-quick-install-action@v34
with:
nix_conf: ${{ env.nix-conf }}
- uses: cachix/cachix-action@v16
with:
name: bbigras-nix-config
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: nix-community
- name: eval
run: |
nix eval --raw '${{ env.flake }}#${{ matrix.attrs.attr }}' --impure
build-linux-builder:
name: build linux-builder for ${{ matrix.attrs.name }} (${{ matrix.attrs.equivalentLinuxPlatform }})
if: ${{ fromJson(needs.get-attrs.outputs.darwin-hosts)[0] != null }}
runs-on: ${{ matrix.attrs.equivalentLinuxRunner }}
needs: [get-attrs]
strategy:
fail-fast: false
matrix:
attrs: ${{ fromJson(needs.get-attrs.outputs.darwin-hosts) }}
env:
system: ${{ matrix.attrs.equivalentLinuxPlatform }}
steps:
- uses: nixbuild/nix-quick-install-action@v34
with:
nix_conf: ${{ env.nix-conf }}
- uses: cachix/cachix-action@v16
with:
name: bbigras-nix-config
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: nix-community
- name: nix-fast-build
run: nix run '${{ env.flake }}#nix-fast-build' -- ${{ env.nix-fast-build-args }} --systems=${{ env.system }} --flake='${{ env.flake }}#${{ matrix.attrs.linuxBuilderAttr }}'
build-darwin-host:
name: build ${{ matrix.attrs.name }} (${{ matrix.attrs.hostPlatform }})
if: ${{ fromJson(needs.get-attrs.outputs.darwin-hosts)[0] != null }}
runs-on: ${{ matrix.attrs.runsOn }}
needs: [get-attrs, build-linux-builder]
strategy:
fail-fast: false
matrix:
attrs: ${{ fromJson(needs.get-attrs.outputs.darwin-hosts) }}
env:
system: ${{ matrix.attrs.hostPlatform }}
steps:
- uses: nixbuild/nix-quick-install-action@v34
with:
nix_conf: ${{ env.nix-conf }}
- uses: cachix/cachix-action@v16
with:
name: bbigras-nix-config
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: nix-community
- name: nix-fast-build
run: nix run '${{ env.flake }}#nix-fast-build' -- ${{ env.nix-fast-build-args }} --systems=${{ env.system }} --flake='${{ env.flake }}#${{ matrix.attrs.attr }}'
build:
name: build ${{ matrix.attrs.name }} (${{ matrix.attrs.hostPlatform }})
runs-on: ${{ matrix.attrs.runsOn }}
needs: [get-attrs]
strategy:
fail-fast: false
matrix:
attrs: ${{ fromJson(needs.get-attrs.outputs.build) }}
env:
system: ${{ matrix.attrs.hostPlatform }}
steps:
- uses: wimpysworld/nothing-but-nix@main
with:
hatchet-protocol: "holster"
nix-permission-edict: true
- uses: nixbuild/nix-quick-install-action@v34
with:
nix_conf: ${{ env.nix-conf }}
- uses: cachix/cachix-action@v16
with:
name: bbigras-nix-config
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: nix-community
- name: nix-fast-build
run: nix run '${{ env.flake }}#nix-fast-build' -- ${{ env.nix-fast-build-args }} --systems=${{ env.system }} --flake='${{ env.flake }}#${{ matrix.attrs.attr }}'
check:
runs-on: ubuntu-24.04
needs:
[
flake-check,
flake-show,
build,
eval,
build-linux-builder,
build-darwin-host,
]
if: always()
steps:
- uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
allowed-skips: eval, build-linux-builder, build-darwin-host