Skip to content

Commit c98a72f

Browse files
committed
Verify Nix package in CI
1 parent 2568963 commit c98a72f

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

.github/workflows/nix.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Nix
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: nix-${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
package:
19+
runs-on: ubuntu-24.04
20+
timeout-minutes: 30
21+
steps:
22+
- uses: actions/checkout@v5
23+
24+
- name: Install Nix
25+
uses: cachix/install-nix-action@v31
26+
with:
27+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Check flake
30+
run: nix flake check --no-update-lock-file --print-build-logs
31+
32+
- name: Build package
33+
run: nix build .#autolith --no-update-lock-file --print-build-logs
34+
35+
- name: Smoke-test first run
36+
shell: bash
37+
run: |
38+
set -euo pipefail
39+
temporary_home=$(mktemp -d)
40+
export HOME="$temporary_home/home"
41+
export XDG_CONFIG_HOME="$temporary_home/config"
42+
export XDG_DATA_HOME="$temporary_home/data"
43+
export XDG_STATE_HOME="$temporary_home/state"
44+
45+
status=0
46+
timeout 600s ./result/bin/autolith </dev/null \
47+
>"$temporary_home/stdout" \
48+
2>"$temporary_home/stderr" || status=$?
49+
50+
cat "$temporary_home/stderr"
51+
cat "$temporary_home/stdout"
52+
test "$status" -eq 0
53+
test -f "$XDG_DATA_HOME/autolith/recovery/autolith-recovery.core"
54+
test -f "$XDG_DATA_HOME/autolith/recovery/manifest.sexp"
55+
test -f "$XDG_DATA_HOME/autolith/active/autolith-active.core"
56+
test -f "$XDG_DATA_HOME/autolith/active/manifest.sexp"
57+
grep -F "Installed pristine recovery image" "$temporary_home/stdout"
58+
grep -F "Installed preloaded active image" "$temporary_home/stdout"
59+
grep -F "AUTOLITH v" "$temporary_home/stdout"

0 commit comments

Comments
 (0)