Skip to content

Commit 4331bf1

Browse files
committed
feat: surface evaluation warnings in CI
1 parent e3b99ed commit 4331bf1

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,23 @@ jobs:
1515
github_access_token: ${{ secrets.GITHUB_TOKEN }}
1616
- name: Check all configurations evaluate
1717
run: |
18-
for host in glyph spore zeta; do
18+
eval_host() {
19+
local host="$1"
20+
local expr="$2"
1921
echo "Evaluating $host..."
20-
nix eval .#nixosConfigurations.$host.config.system.build.toplevel.drvPath
22+
stderr=$(nix eval "$expr" 2>&1 >/dev/null)
23+
if [ -n "$stderr" ]; then
24+
echo "$stderr"
25+
if echo "$stderr" | grep -q "evaluation warning:"; then
26+
encoded=$(printf '%s' "$stderr" | python3 -c "import sys; print(sys.stdin.read().replace('%','%25').replace('\n','%0A').replace('\r','%0D'))")
27+
echo "::warning title=Evaluation warnings ($host)::${encoded}"
28+
fi
29+
fi
30+
}
31+
for host in glyph spore zeta; do
32+
eval_host "$host" ".#nixosConfigurations.$host.config.system.build.toplevel.drvPath"
2133
done
22-
echo "Evaluating Rhizome..."
23-
nix eval .#darwinConfigurations.Rhizome.system.drvPath
34+
eval_host "Rhizome" ".#darwinConfigurations.Rhizome.system.drvPath"
2435
2536
build:
2637
needs: eval

0 commit comments

Comments
 (0)