about summary refs log tree commit diff
path: root/maintainers/scripts/travis-nox-review-pr.sh
blob: 8ba5a4f61cf8e31f36f2489aa15537daf985ba3e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#! /usr/bin/env bash
set -e

# Install Nix
bash <(curl https://nixos.org/nix/install)
source $HOME/.nix-profile/etc/profile.d/nix.sh

# Make sure we can use hydra's binary cache
sudo mkdir /etc/nix
echo "binary-caches = http://cache.nixos.org http://hydra.nixos.org" | sudo tee /etc/nix/nix.conf
echo "trusted-binary-caches = http://hydra.nixos.org" | sudo tee -a /etc/nix/nix.conf

if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
    echo "Not a pull request, checking evaluation"
    nix-env -f. -qaP --drv-path
    exit 0
fi

echo "Installing nox"
git clone https://github.com/madjar/nox
pip install -e nox

echo "Reviewing PR"
# The current HEAD is the PR merged into origin/master, so we compare
# against origin/master
nox-review wip --against origin/master