generated from nix-community/nur-packages-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathci.sh
executable file
·38 lines (35 loc) · 822 Bytes
/
ci.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
set -euo pipefail
args=(
--accept-flake-config
--gc-roots-dir gcroot
--max-memory-size "12000"
--option allow-import-from-derivation false
--option restrict-eval true
--show-trace
--workers 4
"$@"
)
exitCode=0
attrsWithError=()
for job in $(nix-eval-jobs "${args[@]}" 2>/dev/null | jq -r '. | @base64'); do
job=$(echo "$job" | base64 -d)
attr=$(echo "$job" | jq -r .attr)
echo "### $attr"
error=$(echo "$job" | jq -r .error)
if [[ $error != null ]]; then
echo "### ❌ $attr"
echo
echo "<details><summary>Eval error:</summary><pre>"
echo "$error"
echo "</pre></details>"
attrsWithError+=($attr)
exitCode=1
else
echo "### ✅ $attr"
fi
done
if [[ $exitCode == 1 ]]; then
echo "### ❌ Errors in: ${attrsWithError[*]}"
fi
exit $exitCode