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
36 lines
1.2 KiB
YAML
36 lines
1.2 KiB
YAML
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
|