diff --git a/.github/workflows/flake_evaltests.yml b/.github/workflows/flake_evaltests.yml index 1b868966..e76b7204 100644 --- a/.github/workflows/flake_evaltests.yml +++ b/.github/workflows/flake_evaltests.yml @@ -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" diff --git a/Justfile b/Justfile index 138acd6f..3f214486 100644 --- a/Justfile +++ b/Justfile @@ -21,7 +21,7 @@ default: # Run eval tests [group('nix')] test: - nix eval .#evalTests --show-trace --print-build-logs --verbose + let result = (nix eval .#evalTests --json --show-trace --print-build-logs --verbose | str trim); if $result != "true" { error make { msg: $"eval tests failed: evalTests returned ($result)" } } # Evaluate a NixOS host configuration without building it. [group('nix')]