nix-bitcoin/ci/build.sh

30 lines
672 B
Bash
Raw Normal View History

#!/usr/bin/env bash
# This script can also be run locally for testing:
# scenario=default ./build.sh
#
# When variable CIRRUS_CI is unset, this script leaves no persistent traces on the host system.
set -euo pipefail
scenario=${scenario:-}
if [[ -v CIRRUS_CI && $scenario ]]; then
if [[ ! -e /dev/kvm ]]; then
>&2 echo "No KVM available on VM host."
exit 1
fi
# Enable KVM access for nixbld users
chmod o+rw /dev/kvm
fi
echo "$NIX_PATH ($(nix eval --raw nixpkgs.lib.version))"
if [[ $scenario ]]; then
2020-12-11 04:26:10 -08:00
testArgs="--scenario $scenario"
else
2020-12-11 04:26:10 -08:00
testArgs=pkgsUnstable
fi
2020-12-11 04:26:10 -08:00
"${BASH_SOURCE[0]%/*}/../test/run-tests.sh" --ci $testArgs