mirror of
https://github.com/ilyakooo0/haskell.nix.git
synced 2024-09-20 11:27:22 +03:00
edc948e0e8
* Use hydra-migration in check-hydra.nix * mkdocs fix is now in nixpkgs 20.03 (so this drops our work around) * Adds sanity checks for #660 * Add missing ${targetPrefix} to NIX_LDFLAGS * Use eval system for callStackToNix. * Improves pins.
42 lines
1.3 KiB
Nix
42 lines
1.3 KiB
Nix
{ stdenv, writeScript, coreutils, time, gnutar, gzip, hydra-migration, jq }:
|
|
|
|
with stdenv.lib;
|
|
|
|
writeScript "check-hydra.sh" ''
|
|
#!${stdenv.shell}
|
|
|
|
set -euo pipefail
|
|
|
|
export PATH="${makeBinPath [ coreutils time gnutar gzip hydra-migration jq ]}"
|
|
|
|
echo '~~~ Evaluating release.nix with --arg ifdLevel '$1
|
|
command time --format '%e' -o eval-time.txt \
|
|
hydra-eval-jobs \
|
|
--option allowed-uris "https://github.com/NixOS https://github.com/input-output-hk" \
|
|
--arg supportedSystems '[ builtins.currentSystem ]' \
|
|
--arg ifdLevel $1 \
|
|
-I . release.nix > eval.json
|
|
EVAL_EXIT_CODE="$?"
|
|
if [ "$EVAL_EXIT_CODE" != 0 ]
|
|
then
|
|
rm eval.json eval-time.txt
|
|
echo -e "\\e[31;1mERROR: Failed to evaluate release.nix\\e[0m"
|
|
exit 1
|
|
fi
|
|
EVAL_TIME=$(cat eval-time.txt)
|
|
jq . < eval.json
|
|
ERRORS=$(jq -r 'map_values(.error)|to_entries[]|select(.value)|@text "\(.key): \(.value)"' < eval.json)
|
|
NUM_ERRORS=$(jq -r '[ map_values(.error)|to_entries[]|select(.value) ] |length' < eval.json)
|
|
rm eval.json eval-time.txt
|
|
|
|
if [ "$NUM_ERRORS" != 0 ]
|
|
then
|
|
echo -e "\\e[31;1mERROR: evaluation completed in $EVAL_TIME seconds with $NUM_ERRORS errors\\e[0m"
|
|
echo "$ERRORS"
|
|
exit 1
|
|
else
|
|
echo -e "\\e[32;1mOK: evaluation completed in $EVAL_TIME seconds with no errors\\e[0m"
|
|
exit 0
|
|
fi
|
|
''
|