62 lines
1.3 KiB
Bash
Executable File
62 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
args=(
|
|
"$@"
|
|
--accept-flake-config
|
|
--gc-roots-dir gc-root
|
|
--option allow-import-from-derivation false
|
|
--show-trace
|
|
--force-recurse
|
|
--workers "$(nproc)"
|
|
--flake ".#checks.x86_64-linux"
|
|
)
|
|
|
|
summary=summary.log
|
|
|
|
if [[ -n "${GITHUB_STEP_SUMMARY-}" ]]; then
|
|
log() {
|
|
echo "$*" >> "$GITHUB_STEP_SUMMARY"
|
|
}
|
|
else
|
|
log() {
|
|
echo "$*" > "$summary"
|
|
}
|
|
fi
|
|
|
|
rc=0
|
|
|
|
nix shell --inputs-from '.#' "nixpkgs#nix-eval-jobs" -c nix-eval-jobs "${args[@]}" > "jobs.json"
|
|
|
|
for job in $(jq -r '. | @base64' < "jobs.json"); do
|
|
job=$(echo "$job" | base64 -d)
|
|
attr=$(echo "$job" | jq -r .attr)
|
|
echo "### $attr"
|
|
error=$(echo "$job" | jq -r .error)
|
|
if [[ $error != null ]]; then
|
|
log "### ❌ $attr"
|
|
log
|
|
log "<details><summary>Eval error:</summary><pre>"
|
|
log "$error"
|
|
log "</pre></details>"
|
|
rc=1
|
|
else
|
|
drvPath=$(echo "$job" | jq -r .drvPath)
|
|
if ! nix-store --option keep-going true --realize "$drvPath" 2>&1 | tee build-log.txt; then
|
|
log "### ❌ $attr"
|
|
log
|
|
log "<details><summary>Build error:</summary>last 50 lines:<pre>"
|
|
log "$(tail -n 50 build-log.txt)"
|
|
log "</pre></details>"
|
|
rc=1
|
|
else
|
|
log "### ✅ $attr"
|
|
fi
|
|
log
|
|
rm build-log.txt
|
|
fi
|
|
done
|
|
|
|
if [[ -f "$summary" ]]; then cat "$summary"; fi
|
|
exit "$rc"
|