diff --git a/.travis-ci.sh b/.travis-ci.sh new file mode 100644 index 00000000..659a80b7 --- /dev/null +++ b/.travis-ci.sh @@ -0,0 +1,31 @@ +#!/bin/bash -xue + +PATH=~/ocaml/bin:$PATH; export PATH + +TARGET="$1"; shift + +case "$TARGET" in + prepare) + if [ ! -e ~/ocaml/cached-version -o "$(cat ~/ocaml/cached-version)" != "$OCAML_VERSION.$OCAML_RELEASE" ] ; then + rm -rf ~/ocaml + mkdir -p ~/ocaml/src + cd ~/ocaml/src + wget http://caml.inria.fr/pub/distrib/ocaml-$OCAML_VERSION/ocaml-$OCAML_VERSION.$OCAML_RELEASE.tar.gz + tar -xzf ocaml-$OCAML_VERSION.$OCAML_RELEASE.tar.gz + cd ocaml-$OCAML_VERSION.$OCAML_RELEASE + ./configure -prefix ~/ocaml + make world.opt + make install + cd .. + rm -rf src + echo "$OCAML_VERSION.$OCAML_RELEASE" > ~/ocaml/cached-version + fi + ;; + build) + ocaml bootstrap.ml + ./boot.exe --subst + ./boot.exe --dev + ;; + *) + echo "bad command $TARGET">&2; exit 1 +esac diff --git a/.travis.yml b/.travis.yml index 3d4d6e97..00ee2453 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,20 @@ language: c -sudo: required -install: wget https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/.travis-opam.sh -script: bash -ex .travis-opam.sh +sudo: false + +cache: + directories: + - $HOME/ocaml + +install: bash -ex .travis-ci.sh prepare +script: bash -ex .travis-ci.sh build env: global: - PACKAGE=jbuilder matrix: - - OCAML_VERSION=4.02 - - OCAML_VERSION=4.03 - - OCAML_VERSION=4.04 + - OCAML_VERSION=4.02 OCAML_RELEASE=3 + - OCAML_VERSION=4.03 OCAML_RELEASE=0 + - OCAML_VERSION=4.04 OCAML_RELEASE=2 + - OCAML_VERSION=4.05 OCAML_RELEASE=0+rc1 os: - linux - osx