2020-12-02 22:09:08 +03:00
|
|
|
#!/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:-}
|
|
|
|
|
2020-12-11 15:26:07 +03:00
|
|
|
if [[ -v CIRRUS_CI && $scenario ]]; then
|
|
|
|
if [[ ! -e /dev/kvm ]]; then
|
|
|
|
>&2 echo "No KVM available on VM host."
|
|
|
|
exit 1
|
2020-12-02 22:09:08 +03:00
|
|
|
fi
|
2020-12-11 15:26:07 +03:00
|
|
|
# Enable KVM access for nixbld users
|
|
|
|
chmod o+rw /dev/kvm
|
2020-12-02 22:09:08 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "$NIX_PATH ($(nix eval --raw nixpkgs.lib.version))"
|
|
|
|
|
|
|
|
if [[ $scenario ]]; then
|
2020-12-11 15:26:10 +03:00
|
|
|
testArgs="--scenario $scenario"
|
2020-12-02 22:09:08 +03:00
|
|
|
else
|
2020-12-11 15:26:10 +03:00
|
|
|
testArgs=pkgsUnstable
|
2020-12-02 22:09:08 +03:00
|
|
|
fi
|
|
|
|
|
2020-12-11 15:26:10 +03:00
|
|
|
"${BASH_SOURCE[0]%/*}/../test/run-tests.sh" --ci $testArgs
|