-
Notifications
You must be signed in to change notification settings - Fork 3
80 lines (74 loc) · 2.2 KB
/
flake-build.yaml
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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Build flake
concurrency: build
on:
pull_request:
push:
branches-ignore:
- 'update/flake'
workflow_dispatch:
jobs:
show:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install nix
uses: ./.github/actions/install-nix
- name: Flake show
run: nix flake show
generate_matrix:
runs-on: ubuntu-latest
outputs:
flake_outputs: ${{ steps.generate_flake_outputs.outputs.flake_outputs }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install nix
uses: ./.github/actions/install-nix
- id: generate_flake_outputs
name: Generate flake output matrix
run: nix run .#dotci -L -- build-matrix >> $GITHUB_OUTPUT
build:
runs-on: ubuntu-latest
needs: [generate_matrix]
if: ${{ needs.generate_matrix.outputs.flake_outputs != '[]' && needs.generate_matrix.outputs.flake_outputs != '' }}
strategy:
fail-fast: false
# max-parallel: 5
matrix:
flake_output: ${{ fromJson(needs.generate_matrix.outputs.flake_outputs )}}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install nix
uses: ./.github/actions/install-nix
- name: Set up cachix
uses: cachix/cachix-action@master
with:
name: viperml
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
pathsToPush: result
- name: Build output
run: nix build .#${{ matrix.flake_output }} -L
eval:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
flake_output: [
nixosConfigurations.hermes.config.system.build.toplevel,
homeConfigurations.ayats.activationPackage
]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install nix
uses: ./.github/actions/install-nix
- name: Set up cachix
uses: cachix/cachix-action@master
with:
name: viperml
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Eval output
run: nix build .#${{ matrix.flake_output }} -L --dry-run --print-out-paths -j0