diff --git a/.travis.yml b/.travis.yml index 36f9997..be15dbc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,44 +1,57 @@ language: c -# Supply at least one RACKET_VERSION environment variable definition -# here. RACKET_VERSION is used by the install-racket.sh script -# (specifed below under before_install) to select the version of -# Racket to download and install. +# Optional: To use Travis CI's newer container infrastucture, +# un-comment the following line. (Also be sure RACKET_DIR is set to +# somewhere like ~/racket that doesn't require sudo.) # -# If you supply more than one, you can create multiple builds (a -# Travis-CI build matrix resulting in multiple builds). You can use -# this to test against multiple Racket versions. +# sudo: false + env: - - RACKET_VERSION=5.3.4 - - RACKET_VERSION=5.3.5 - - RACKET_VERSION=5.92 - - RACKET_VERSION=6.0 - - RACKET_VERSION=6.1 - - RACKET_VERSION=6.1.1 - - RACKET_VERSION=HEAD + global: + # Supply a global RACKET_DIR environment variable. This is where + # Racket will be installed. A good idea is to use ~/racket because + # that doesn't require sudo to install and is therefore compatible + # with Travis CI's newer container infrastructure. + - RACKET_DIR=~/racket + matrix: + # Supply at least one RACKET_VERSION environment variable. This is + # used by the install-racket.sh script (run at before_install, + # below) to select the version of Racket to download and install. + # + # Supply more than one RACKET_VERSION (as in the example below) to + # create a Travis-CI build matrix to test against multiple Racket + # versions. + - RACKET_VERSION=5.3.4 + - RACKET_VERSION=5.3.5 + - RACKET_VERSION=5.92 + - RACKET_VERSION=6.0 + - RACKET_VERSION=6.1 + - RACKET_VERSION=6.1.1 + - RACKET_VERSION=HEAD before_install: -- git clone https://github.com/greghendershott/travis-racket.git -- cat travis-racket/install-racket.sh | bash # pipe to bash not sh! + - git clone https://github.com/greghendershott/travis-racket.git + - cat travis-racket/install-racket.sh | bash # pipe to bash not sh! + - export PATH="${RACKET_DIR}/bin:${PATH}" #install-racket.sh can't set for us install: before_script: -# Here supply steps such as raco make, raco test, etc. Note that you -# need to supply /usr/racket/bin/ -- it's not in PATH. You can run -# `raco pkg install --deps search-auto ` to install any required -# packages without it getting stuck on a confirmation prompt. +# Here supply steps such as raco make, raco test, etc. +# +# Tip: Use `raco pkg install --deps search-auto ` to install any +# required packages without getting stuck on a confirmation prompt. script: - - /usr/racket/bin/raco make main.rkt - - /usr/racket/bin/raco test -x . + - raco make main.rkt + - raco test -x . # NOTE: If your repo is a Racket package with an info.rkt that # includes some `deps`, the following is more elegant: # # script: # - cd .. # Travis did a cd into the dir. Back up, for the next: -# - /usr/racket/bin/raco pkg install --deps search-auto --link -# - /usr/racket/bin/raco test -x -p +# - raco pkg install --deps search-auto --link +# - raco test -x -p after_script: diff --git a/install-racket.sh b/install-racket.sh index cb36ea0..c385578 100755 --- a/install-racket.sh +++ b/install-racket.sh @@ -4,7 +4,7 @@ set -e if [[ "$RACKET_VERSION" = "HEAD" ]]; then - URL="http://www.cs.utah.edu/plt/snapshots/current/installers/racket-current-x86_64-linux-precise.sh" + URL="http://plt.eecs.northwestern.edu/snapshots/current/installers/racket-test-current-x86_64-linux-precise.sh" elif [[ "$RACKET_VERSION" = 5.9* ]]; then URL="http://download.racket-lang.org/installers/${RACKET_VERSION}/racket-${RACKET_VERSION}-x86_64-linux-ubuntu-quantal.sh" elif [[ "$RACKET_VERSION" = 6.* ]]; then @@ -13,17 +13,33 @@ else URL="http://download.racket-lang.org/installers/${RACKET_VERSION}/racket/racket-${RACKET_VERSION}-bin-x86_64-linux-debian-squeeze.sh" fi -INSTALL="./racket-${RACKET_VERSION}.sh" +# Older .travis.yml files don't set $RACKET_DIR (the Racket install +# directory) explicitly and expect it to be /usr/racket. +if [[ "$RACKET_DIR" = "" ]]; then + RACKET_DIR=/usr/racket +fi + +INSTALLER="./racket-${RACKET_VERSION}.sh" + +echo "Downloading $URL to $INSTALLER:" +curl -L -o $INSTALLER $URL + +echo "Making $INSTALLER executable:" +chmod u+rx "$INSTALLER" + +# Only use sudo if installing to /usr +if [[ "$RACKET_DIR" = /usr* ]]; then + RUN_INSTALLER="sudo ${INSTALLER}" +else + RUN_INSTALLER="${INSTALLER}" +fi -echo "Downloading $URL to $INSTALL:" -curl -L -o $INSTALL $URL +echo "Running $RUN_INSTALLER to install Racket:" -echo "Running $INSTALL to install Racket:" -chmod u+rx "$INSTALL" -sudo "$INSTALL" <