mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-11-16 13:21:01 +01:00
* fix(ci): fail the eval-test run when the suite does not pass `nix eval .#evalTests` prints the suite result but exits 0 either way, so both `just test` and the CI workflow reported success even when a test failed. Compare the raw boolean and fail instead. * fix(ci): use --json for the boolean eval result `nix eval --raw` cannot coerce a Boolean to a string, and Just runs each recipe line as a separate `nu -c`, so the result variable must stay on one line.
43 lines
1.0 KiB
YAML
43 lines
1.0 KiB
YAML
name: Nix Flake Eval Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths-ignore:
|
|
- "scripts/**"
|
|
- "**.md"
|
|
- "**.nu"
|
|
- "Justfile"
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
paths-ignore:
|
|
- "scripts/**"
|
|
- "**.md"
|
|
- "**.nu"
|
|
- "Justfile"
|
|
|
|
jobs:
|
|
checks:
|
|
name: Check expressions
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v5
|
|
- name: Install nix
|
|
uses: cachix/install-nix-action@v31
|
|
with:
|
|
install_url: https://nixos.org/nix/install
|
|
extra_nix_config: |
|
|
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
|
experimental-features = nix-command flakes
|
|
|
|
- name: Run Nix Flake Eval Tests
|
|
run: |
|
|
echo 'Flake Eval Tests'
|
|
# `nix eval` prints the suite result but still exits 0 on failure, so
|
|
# compare the JSON boolean explicitly to fail the job.
|
|
test "$(nix eval .#evalTests --json --show-trace)" = "true"
|