-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (114 loc) · 3.58 KB
/
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
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
jobs:
build-nixos-configuration:
needs:
- check-flake-and-formatter
- check-eval-host
runs-on: ubuntu-latest
steps:
- if: ${{ (github.event.inputs.host == 'all') || (matrix.host == github.event.inputs.host)
|| (github.event.pull_request.head.repo.full_name == github.repository) ||
(github.event_name == 'push') }}
name: Make More Space
run: 'echo "=== Before pruning ==="
df -h
sudo rm -rf /usr/share /usr/local /opt || true
echo
echo "=== After pruning ==="
df -h
'
- if: ${{ (github.event.inputs.host == 'all') || (matrix.host == github.event.inputs.host)
|| (github.event.pull_request.head.repo.full_name == github.repository) ||
(github.event_name == 'push') }}
name: Set Swap Space
uses: pierotofy/[email protected]
with:
swap-size-gb: 10
- if: ${{ (github.event.inputs.host == 'all') || (matrix.host == github.event.inputs.host)
|| (github.event.pull_request.head.repo.full_name == github.repository) ||
(github.event_name == 'push') }}
name: Checkout
uses: actions/checkout@v3
- if: ${{ (github.event.inputs.host == 'all') || (matrix.host == github.event.inputs.host)
|| (github.event.pull_request.head.repo.full_name == github.repository) ||
(github.event_name == 'push') }}
name: Install Nix
uses: cachix/install-nix-action@v25
with:
github_access_token: ${{ secrets.PAT }}
- if: ${{ (github.event.inputs.host == 'all') || (matrix.host == github.event.inputs.host)
|| (github.event.pull_request.head.repo.full_name == github.repository) ||
(github.event_name == 'push') }}
name: Setup Attic Cache
uses: icewind1991/[email protected]
with:
authToken: ${{ secrets.ATTIC_HELLO_TOKEN }}
instance: https://attic.edgerunners.eu.org
name: hello
- if: ${{ (github.event.inputs.host == 'all') || (matrix.host == github.event.inputs.host)
|| (github.event.pull_request.head.repo.full_name == github.repository) ||
(github.event_name == 'push') }}
name: Build Host ${{ matrix.host }}
run: "nix build --print-build-logs .#nixosConfigurations.${{ matrix.host }}.config.system.build.toplevel\
\ \n"
strategy:
fail-fast: false
matrix:
host:
- dui
- ge
- lei
- xun
- zheng
check-eval-host:
needs: check-flake-and-formatter
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v25
with:
github_access_token: ${{ secrets.PAT }}
- name: Eval Host ${{ matrix.host }}
run: 'nix eval --raw .#nixosConfigurations.${{ matrix.host }}.config.system.build.toplevel
'
strategy:
fail-fast: false
matrix:
host:
- dui
- ge
- lei
- xun
- zheng
check-flake-and-formatter:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v25
with:
github_access_token: ${{ secrets.PAT }}
- name: Flake Check
run: nix flake check --verbose --print-build-logs
name: Build
'on':
pull_request: {}
push:
branches:
- main
workflow_dispatch:
inputs:
host:
default: all
description: Host to build
options:
- dui
- ge
- lei
- xun
- zheng
- all
required: true
type: choice