mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-11-13 12:13:46 +01:00
fix(ci): fail the eval-test run when the suite does not pass (#350)
* 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.
This commit is contained in:
1 parent
d9208f492b
commit
dafd16f447
2 files changed
+4
-4
No files matched your search
@@ -37,6 +37,6 @@ jobs:
|
||||
- name: Run Nix Flake Eval Tests
|
||||
run: |
|
||||
echo 'Flake Eval Tests'
|
||||
# stack overflow...
|
||||
# nix eval .#checks --show-trace --print-build-logs --verbose
|
||||
nix eval .#evalTests --show-trace --print-build-logs --verbose
|
||||
# `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"
|
||||
Reference in new issue
Block a user