-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (50 loc) · 1.53 KB
/
Copy pathci.yml
File metadata and controls
53 lines (50 loc) · 1.53 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
name: CI
on: push
jobs:
nix-build:
name: nix-build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
steps:
- name: checkout
uses: actions/checkout@v7
- name: install nix
uses: cachix/install-nix-action@v31
with:
github_access_token: ${{ github.token }}
- name: cache nix store
uses: nix-community/cache-nix-action@v7
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('nix/flake.lock') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
- name: build
run: |
SYSTEM=$(uname -m)-$(uname -s | tr '[:upper:]' '[:lower:]')
case "$SYSTEM" in
arm64-darwin) SYSTEM="aarch64-darwin" ;;
x86_64-darwin) SYSTEM="x86_64-darwin" ;;
aarch64-linux) SYSTEM="aarch64-linux" ;;
x86_64-linux) SYSTEM="x86_64-linux" ;;
esac
nix build "./nix#homeConfigurations.${SYSTEM}.activationPackage" --impure --print-build-logs --show-trace
install-test:
name: install-test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
steps:
- name: checkout
uses: actions/checkout@v7
with:
path: dotfiles
- name: move to home
run: mv dotfiles $HOME/dotfiles
- name: run install.sh
run: $HOME/dotfiles/bin/install.sh
env:
NIX_CONFIG: "access-tokens = github.com=${{ github.token }}"
- name: validate
run: test -d $HOME/dotfiles