-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (111 loc) · 3.5 KB
/
build.yml
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
name: 'Build and populate cache'
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
schedule:
# rebuild everyday at 3:35
# TIP: Choose a random time here so not all repositories are build at once:
# https://www.random.org/clock-times/?num=1&earliest=01%3A00&latest=08%3A00&interval=5&format=html&rnd=new
- cron: '35 3 * * *'
jobs:
build-packages:
strategy:
fail-fast: false
matrix:
system:
- x86_64-linux
# - aarch64-linux
runs-on: ubuntu-latest
env:
GIT_SSL_NO_VERIFY: 'true'
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 512
swap-size-mb: 1024
build-mount-path: '/nix'
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: all
- name: Install nix
uses: cachix/install-nix-action@v24
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
experimental-features = nix-command flakes
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
extra-platforms = i686-linux aarch64-linux arm-linux
- name: Setup cachix
uses: cachix/cachix-action@v13
with:
name: moraxyc
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Set nix daemon tmpdir path
run: |
sudo mkdir -p /nix/tmpdir
sudo chown $(whoami) /nix/tmpdir
cat > override.conf <<EOF
[Service]
Environment="TMPDIR=/nix/tmpdir"
EOF
sudo mkdir /etc/systemd/system/nix-daemon.service.d/
sudo mv override.conf /etc/systemd/system/nix-daemon.service.d/override.conf
sudo systemctl daemon-reload
sudo systemctl restart nix-daemon
- name: Build nix packages
run: |
nix flake update
env TMPDIR=/nix/tmpdir nix run .#ci -- ${{ matrix.system }}
test-nur-eval:
strategy:
fail-fast: false
matrix:
system:
- x86_64-linux
# - aarch64-linux
runs-on: ubuntu-latest
env:
GIT_SSL_NO_VERIFY: 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: all
- name: Install nix
uses: cachix/install-nix-action@v24
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
experimental-features = nix-command flakes
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
extra-platforms = i686-linux aarch64-linux arm-linux
- name: Build nix packages
run: |
nix run .#nur-check
# update-nur:
# runs-on: ubuntu-latest
# needs:
# - build-packages
# - test-nur-eval
# steps:
# - name: Trigger NUR update
# run: curl -XPOST "https://nur-update.nix-community.org/update?repo=moraxyc"