Skip to content

Commit

Permalink
travis: use opam-rt on same branch name, for easier simultaneous patches
Browse files Browse the repository at this point in the history
  • Loading branch information
AltGr committed Oct 19, 2015
1 parent 5fdb159 commit e74f6e5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .travis-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ install_on_osx () {
fi
}

source_branch_name () {
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
echo $TRAVIS_BRANCH
else
curl -s https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST | sed -n '/^ *"head":/ { :loop; s/^ *"ref": "\(.*\)",/\1/p; t quit; n; b loop; :quit }'
fi
}

case $TRAVIS_OS_NAME in
osx) install_on_osx ;;
linux) install_on_linux ;;
Expand Down Expand Up @@ -70,6 +78,7 @@ if [ "$OPAM_TEST" = "1" ]; then
sudo make install
make libinstall prefix=$(opam config var prefix)
# Compile and run opam-rt
wget https://github.com/ocaml/opam-rt/archive/$(source_branch_name).tar.gz -O opam-rt.tar.gz || \
wget https://github.com/ocaml/opam-rt/archive/master.tar.gz -O opam-rt.tar.gz
tar xvfz opam-rt.tar.gz
cd opam-rt-*
Expand Down

0 comments on commit e74f6e5

Please sign in to comment.