2014-09-21 11:09:35 +00:00
|
|
|
#! /usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
|
2016-06-27 21:29:12 +00:00
|
|
|
while test -n "$1"; do
|
2014-09-21 11:09:35 +00:00
|
|
|
|
2016-06-27 21:29:12 +00:00
|
|
|
# tell Travis to use folding
|
|
|
|
echo -en "travis_fold:start:$1\r"
|
|
|
|
|
|
|
|
case $1 in
|
|
|
|
|
2016-07-07 19:18:42 +00:00
|
|
|
nixpkgs-verify)
|
2016-06-27 21:29:12 +00:00
|
|
|
echo "=== Verifying that nixpkgs evaluates..."
|
|
|
|
|
|
|
|
nix-env --file $TRAVIS_BUILD_DIR --query --available --json > /dev/null
|
|
|
|
;;
|
|
|
|
|
2016-07-07 19:18:42 +00:00
|
|
|
nixos-options)
|
2016-06-27 21:29:12 +00:00
|
|
|
echo "=== Checking NixOS options"
|
|
|
|
|
|
|
|
nix-build $TRAVIS_BUILD_DIR/nixos/release.nix --attr options --show-trace
|
|
|
|
;;
|
|
|
|
|
2016-07-07 19:18:42 +00:00
|
|
|
nixos-manual)
|
|
|
|
echo "=== Checking NixOS manuals"
|
|
|
|
|
|
|
|
nix-build $TRAVIS_BUILD_DIR/nixos/release.nix --attr manual --show-trace
|
|
|
|
;;
|
|
|
|
|
|
|
|
nixpkgs-manual)
|
|
|
|
echo "=== Checking nixpkgs manuals"
|
|
|
|
|
2016-08-02 19:44:46 +00:00
|
|
|
nix-build $TRAVIS_BUILD_DIR/pkgs/top-level/release.nix --attr manual --show-trace
|
2016-07-07 19:18:42 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
nixpkgs-tarball)
|
|
|
|
echo "=== Checking nixpkgs tarball creation"
|
2016-06-27 21:29:12 +00:00
|
|
|
|
|
|
|
nix-build $TRAVIS_BUILD_DIR/pkgs/top-level/release.nix --attr tarball --show-trace
|
2016-12-15 21:42:50 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
nixpkgs-unstable)
|
|
|
|
echo "=== Checking nixpkgs unstable job"
|
|
|
|
|
|
|
|
nix-instantiate $TRAVIS_BUILD_DIR/pkgs/top-level/release.nix --attr unstable --show-trace
|
2016-06-27 21:29:12 +00:00
|
|
|
;;
|
|
|
|
|
2016-07-07 20:07:01 +00:00
|
|
|
nixpkgs-lint)
|
|
|
|
echo "=== Checking nixpkgs lint"
|
|
|
|
|
|
|
|
nix-shell --packages nixpkgs-lint --run "nixpkgs-lint -f $TRAVIS_BUILD_DIR"
|
|
|
|
;;
|
|
|
|
|
2016-07-25 18:56:07 +00:00
|
|
|
nox)
|
|
|
|
echo "=== Fetching Nox from binary cache"
|
|
|
|
|
2017-08-14 19:58:12 +00:00
|
|
|
# build nox (+ a basic nix-shell env) silently so it's not in the log
|
|
|
|
nix-shell -p nox stdenv --command true
|
2016-07-25 18:56:07 +00:00
|
|
|
;;
|
|
|
|
|
2016-06-27 21:29:12 +00:00
|
|
|
pr)
|
|
|
|
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
|
|
|
echo "=== No pull request found"
|
|
|
|
else
|
|
|
|
echo "=== Building pull request #$TRAVIS_PULL_REQUEST"
|
|
|
|
|
2016-07-04 17:32:45 +00:00
|
|
|
token=""
|
|
|
|
if [ -n "$GITHUB_TOKEN" ]; then
|
|
|
|
token="--token $GITHUB_TOKEN"
|
|
|
|
fi
|
|
|
|
|
2016-07-25 18:56:07 +00:00
|
|
|
nix-shell --packages nox --run "nox-review pr --slug $TRAVIS_REPO_SLUG $token $TRAVIS_PULL_REQUEST"
|
2016-06-27 21:29:12 +00:00
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
echo "Skipping unknown option $1"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
echo -en "travis_fold:end:$1\r"
|
|
|
|
shift
|
|
|
|
done
|