-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (67 loc) · 2.16 KB
/
ci.yml
File metadata and controls
70 lines (67 loc) · 2.16 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
name: CI
on:
pull_request:
push:
branches: main
jobs:
eval:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Check all configurations evaluate
run: |
for host in glyph spore zeta; do
echo "Evaluating $host..."
nix eval .#nixosConfigurations.$host.config.system.build.toplevel.drvPath
done
echo "Evaluating Rhizome..."
nix eval .#darwinConfigurations.Rhizome.system.drvPath
build:
needs: eval
strategy:
fail-fast: false
matrix:
include:
- host: glyph
system: x86_64-linux
runner: ubuntu-latest
- host: Rhizome
system: aarch64-darwin
runner: macos-latest
- host: spore
system: x86_64-linux
runner: ubuntu-latest
- host: zeta
system: aarch64-linux
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
extra_nix_config: |
extra-substituters = https://cache.zx.dev/main
extra-trusted-public-keys = main:mu0jkxdJTGWC3djDSEQb3rvZgqlhA8WVMulcTo5IW6c=
- name: Configure Attic cache
run: |
nix profile install --inputs-from . attic#attic-client --fallback
attic login rc https://cache.zx.dev ${{ secrets.ATTIC_TOKEN }}
attic use rc:main
- name: Build system configuration
run: |
if [ "${{ matrix.system }}" = "aarch64-darwin" ]; then
nix build .#darwinConfigurations.${{ matrix.host }}.system
else
nix build .#nixosConfigurations.${{ matrix.host }}.config.system.build.toplevel
fi
- name: Push to Attic
if: github.ref == 'refs/heads/main'
run: |
attic push rc:main ./result
attic push rc:main $(which attic)
nix build .#devShells.${{ matrix.system }}.default -o ./result-devshell
attic push rc:main ./result-devshell