ci: nix flake check on every push

Every check in flake.nix, starting with ir-pico's doctests, in the
nixos/nix image, pinned by digest. The checkout is plain git, since
actions/checkout needs node and the image has none.

Generated-by: Claude Opus 5.5
This commit is contained in:
dckc committed 2026-12-02 15:52:55 -06:00
1 parent 147bfdc55e
commit 4a42c896db
2 files changed
+52 -2

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
name: check
# nix flake check: every check in flake.nix, such as ir-pico's doctests.
on:
push:
pull_request:
jobs:
check:
runs-on: ubuntu-latest
# Nix comes from its own image, pinned by digest, not a floating tag: a tag can be moved.
container:
image: nixos/nix:2.35.6@sha256:b49cb33f3a7e5cf3933ad8774529de0e3807ec5cf54987aa7ccdfb49f2fc55ed
env:
# A container can't make the namespaces Nix's build sandbox needs.
NIX_CONFIG: |
experimental-features = nix-command flakes
sandbox = false
steps:
# No actions/checkout: it runs on node, which this image doesn't have, and git does the job.
- name: Check out
env:
SERVER: ${{ gitea.server_url }}
REPO: ${{ gitea.repository }}
REF: ${{ gitea.ref }}
SHA: ${{ gitea.sha }}
# The server won't hand out a bare commit, so fetch the ref that was pushed, then the commit.
run: |
git init -q src
git -C src fetch -q --depth 20 "$SERVER/$REPO.git" "$REF"
git -C src checkout -q --detach "$SHA"
- name: nix flake check
working-directory: src
run: nix flake check -L
+17 -2
View File
@@ -2,6 +2,21 @@
The [README](README.md) says what pdtv26 does and why; this is how to work on it. The [README](README.md) says what pdtv26 does and why; this is how to work on it.
## Working on it ## Development
The tools come from the flake: `nix develop --command make test` in any folder, or `nix develop` once and then `make`. `nix flake check` runs every folder's tests. `make help` in each folder lists what it does, and each module's docstring says what it is. Docs are only for what isn't code, such as [wiring](ir-pico/wiring.md). The tools come from the flake. To run every folder's tests, as [CI](.gitea/workflows/check.yaml) should on each push:
```
nix flake check
```
To work in one folder:
```
cd ir-pico
nix develop
make help
make test
```
Each module's docstring says what it is. Docs are only for what isn't code, such as [wiring](ir-pico/wiring.md).