Files
OBLITERATUS/.github/workflows/nix-parity.yml
Joseph MaglyandClaude Opus 5.5 e5c3b5101a ci(nix): enable flakes through NIX_CONFIG for the single-user install
Single-user (--no-daemon) installs ignore --nix-extra-conf-file, so
nix-command and flakes stayed disabled and 'nix flake check' failed.
Set NIX_CONFIG at workflow level instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 18:14:28 -05:00

78 lines
2.5 KiB
YAML

name: Nix parity
# Exercises the committed flake that contributors use for CI-equivalent local
# runs. It is not part of the required pull-request check; it runs when the
# environment definition changes and on demand.
on:
pull_request:
paths:
- flake.nix
- flake.lock
- uv.lock
- pyproject.toml
- .envrc
- .github/workflows/nix-parity.yml
workflow_dispatch:
permissions:
contents: read
concurrency:
group: nix-parity-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CANDIDATE_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
NIX_VERSION: "2.35.2"
NIX_INSTALLER_SHA256: "9adda97297d9e8ab360df95c729eabff4f4f93d6db091953c3a68f29e3fb130c"
# Single-user installs ignore --nix-extra-conf-file; enable flakes for every step.
NIX_CONFIG: "experimental-features = nix-command flakes"
jobs:
nix-parity:
name: Nix parity py${{ matrix.python }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
# Release gates accept only the release interpreters (3.11, 3.12).
- python: "312"
release_tests: tests/test_release_partitions.py
- python: "313"
release_tests: ""
steps:
- name: Check out exact candidate
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ env.CANDIDATE_SHA }}
persist-credentials: false
- name: Install pinned Nix
run: |
installer="$RUNNER_TEMP/nix-install"
curl --proto '=https' --tlsv1.2 -sSfL \
"https://releases.nixos.org/nix/nix-${NIX_VERSION}/install" -o "$installer"
echo "${NIX_INSTALLER_SHA256} $installer" | sha256sum --check --strict
sh "$installer" --no-daemon --yes
echo "$HOME/.nix-profile/bin" >> "$GITHUB_PATH"
- name: Check flake outputs
run: nix flake check --no-build
- name: Run parity smoke tests
env:
OBLITERATUS_NIX_STATE: ${{ runner.temp }}/nix-test
PYTHON_TAG: ${{ matrix.python }}
RELEASE_TESTS: ${{ matrix.release_tests }}
run: |
# shellcheck disable=SC2086
nix run ".#test-py${PYTHON_TAG}" -- \
tests/test_module_imports.py \
tests/test_bayesian_storage_close.py \
tests/test_offline_integration.py \
tests/test_ci_policy.py \
tests/test_nix_parity_policy.py \
$RELEASE_TESTS