-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (93 loc) · 3.36 KB
/
build.yml
File metadata and controls
108 lines (93 loc) · 3.36 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
name: Build and Check
on:
workflow_dispatch:
push:
pull_request:
schedule:
# 毎週月曜 0:00 UTC に実行 (linux-surface キャッシュ更新)
- cron: "0 0 * * 1"
jobs:
check:
name: Check configuration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: cachix/install-nix-action@96951a368ba55167b55f1c916f7d416bac6505fe # v31.10.3
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Check flake
run: nix flake check
build-heavy:
name: Build heavy packages (${{ matrix.package }})
needs: check
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package:
- linux-surface-lts
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: cachix/install-nix-action@96951a368ba55167b55f1c916f7d416bac6505fe # v31.10.3
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
extra_nix_config: |
cores = 0
accept-flake-config = true
- uses: cachix/cachix-action@1eb2ef646ac0255473d23a5907ad7b04ce94065c # v17
with:
name: meatwo310-dotnix
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Check disk space
run: df -h
- name: Build ${{ matrix.package }}
run: |
nix build .#packages.x86_64-linux.${{ matrix.package }} \
--print-build-logs \
--no-link
- name: Check disk space after build
if: always()
run: df -h
build:
name: Build ${{ matrix.configuration }} (${{ matrix.host }})
needs: build-heavy
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- host: sp9-v7
runner: ubuntu-latest
configuration: nixosConfigurations
- host: gaming-wsl
runner: ubuntu-latest
configuration: nixosConfigurations
- host: m2air
runner: macos-latest
configuration: darwinConfigurations
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: cachix/install-nix-action@96951a368ba55167b55f1c916f7d416bac6505fe # v31.10.3
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
extra_nix_config: |
accept-flake-config = true
# - uses: nix-community/cache-nix-action@7df957e333c1e5da7721f60227dbba6d06080569 # v7.0.2
# with:
# primary-key: nix-${{ runner.os }}-build-${{ matrix.host }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
# restore-prefixes-first-match: nix-${{ runner.os }}-build-${{ matrix.host }}-
# gc-max-store-size-linux: 10G
# purge: true
# purge-prefixes: nix-${{ runner.os }}-build-${{ matrix.host }}-
# purge-created: 0
# purge-last-accessed: P1DT12H
# purge-primary-key: never
- uses: cachix/cachix-action@1eb2ef646ac0255473d23a5907ad7b04ce94065c # v17
with:
name: meatwo310-dotnix
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Build ${{ matrix.host }}
run: |
nix build .#${{ matrix.configuration }}.${{ matrix.host }}.config.system.build.toplevel \
--print-build-logs \
--no-link