-
Notifications
You must be signed in to change notification settings - Fork 4
57 lines (50 loc) · 1.92 KB
/
Copy pathci.yml
File metadata and controls
57 lines (50 loc) · 1.92 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
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
smoke:
name: nix run smoke test
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: nixbuild/nix-quick-install-action@2c9db80fb984ceb1bcaa77cdda3fdf8cfba92035 # v34, 2025-09-24
with:
nix_conf: |
keep-env-derivations = true
keep-outputs = true
- name: Restore and save Nix store
uses: nix-community/cache-nix-action@7df957e333c1e5da7721f60227dbba6d06080569 # v7, 2026-01-08
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
gc-max-store-size-linux: 2G
purge: true
purge-prefixes: nix-${{ runner.os }}-
purge-created: 0
purge-last-accessed: P1DT12H
purge-primary-key: never
- name: nix flake check
run: nix flake check --print-build-logs
# Discover the boxes from the flake itself instead of hard-coding them
# so adding/removing one in nix/packages.nix is automatically picked
# up by CI. Each `nix run` builds the box and its wrapped CLI, launches
# the node script, and exits 0 from the box-level help — a runtime
# equivalent of a build + launcher smoke test.
- name: smoke test every box
run: |
set -euo pipefail
boxes=$(
nix eval --json ".#packages.$(nix eval --impure --raw --expr builtins.currentSystem)" \
--apply 'ps: builtins.filter (n: n != "default") (builtins.attrNames ps)' \
| nix run nixpkgs#jq -- -r '.[]'
)
echo "Boxes discovered: $(echo $boxes | tr '\n' ' ')"
for box in $boxes; do
echo "::group::$box --help"
nix run ".#$box" -- --help
echo "::endgroup::"
done