Run tests on Travis
Signed-off-by: David Allsopp <david.allsopp@metastack.com>
This commit is contained in:
parent
a47e3ab78a
commit
51d6421ae4
|
@ -6,6 +6,7 @@ TARGET="$1"; shift
|
||||||
|
|
||||||
case "$TARGET" in
|
case "$TARGET" in
|
||||||
prepare)
|
prepare)
|
||||||
|
echo -en "travis_fold:start:ocaml\r"
|
||||||
if [ ! -e ~/ocaml/cached-version -o "$(cat ~/ocaml/cached-version)" != "$OCAML_VERSION.$OCAML_RELEASE" ] ; then
|
if [ ! -e ~/ocaml/cached-version -o "$(cat ~/ocaml/cached-version)" != "$OCAML_VERSION.$OCAML_RELEASE" ] ; then
|
||||||
rm -rf ~/ocaml
|
rm -rf ~/ocaml
|
||||||
mkdir -p ~/ocaml/src
|
mkdir -p ~/ocaml/src
|
||||||
|
@ -20,11 +21,47 @@ case "$TARGET" in
|
||||||
rm -rf src
|
rm -rf src
|
||||||
echo "$OCAML_VERSION.$OCAML_RELEASE" > ~/ocaml/cached-version
|
echo "$OCAML_VERSION.$OCAML_RELEASE" > ~/ocaml/cached-version
|
||||||
fi
|
fi
|
||||||
|
echo -en "travis_fold:end:ocaml\r"
|
||||||
|
if [ $WITH_OPAM -eq 1 ] ; then
|
||||||
|
echo -en "travis_fold:start:opam.init\r"
|
||||||
|
sudo add-apt-repository --yes ppa:avsm/ocaml42+opam12
|
||||||
|
sudo apt-get update -qq
|
||||||
|
sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install opam
|
||||||
|
if [ ! -e ~/.opam/lock -o "$OPAM_RESET" = "1" ] ; then
|
||||||
|
rm -rf ~/.opam
|
||||||
|
opam init --yes
|
||||||
|
opam install menhir ocaml-migrate-parsetree js_of_ocaml-ppx --yes
|
||||||
|
opam remove jbuilder `opam list --depends-on jbuilder --installed --short` --yes
|
||||||
|
fi
|
||||||
|
cp -a ~/.opam ~/.opam-start
|
||||||
|
echo -en "travis_fold:end:opam.init\r"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
build)
|
build)
|
||||||
|
if [ $WITH_OPAM -eq 1 ] ; then
|
||||||
|
echo -en "travis_fold:start:opam.deps\r"
|
||||||
|
eval $(opam config env)
|
||||||
|
opam list
|
||||||
|
opam pin add jbuilder . --no-action --yes
|
||||||
|
opam install ocaml-migrate-parsetree js_of_ocaml-ppx --yes
|
||||||
|
echo -en "travis_fold:end:opam.deps\r"
|
||||||
|
fi
|
||||||
|
echo -en "travis_fold:start:jbuilder.bootstrap\r"
|
||||||
ocaml bootstrap.ml
|
ocaml bootstrap.ml
|
||||||
|
echo -en "travis_fold:end:jbuilder.bootstrap\r"
|
||||||
./boot.exe --subst
|
./boot.exe --subst
|
||||||
|
echo -en "travis_fold:start:jbuilder.boot\r"
|
||||||
./boot.exe --dev
|
./boot.exe --dev
|
||||||
|
echo -en "travis_fold:end:jbuilder.boot\r"
|
||||||
|
if [ $WITH_OPAM -eq 1 ] ; then
|
||||||
|
_build/install/default/bin/jbuilder runtest && \
|
||||||
|
_build/install/default/bin/jbuilder build @test/blackbox-tests/runtest-js && \
|
||||||
|
! _build/install/default/bin/jbuilder build @test/fail-with-background-jobs-running
|
||||||
|
RESULT=$?
|
||||||
|
rm -rf ~/.opam
|
||||||
|
mv ~/.opam-start ~/.opam
|
||||||
|
exit $RESULT
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "bad command $TARGET">&2; exit 1
|
echo "bad command $TARGET">&2; exit 1
|
||||||
|
|
43
.travis.yml
43
.travis.yml
|
@ -4,17 +4,38 @@ sudo: false
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- $HOME/ocaml
|
- $HOME/ocaml
|
||||||
|
- $HOME/.opam
|
||||||
|
|
||||||
install: bash -ex .travis-ci.sh prepare
|
install: bash -ex .travis-ci.sh prepare
|
||||||
script: bash -ex .travis-ci.sh build
|
script: bash -ex .travis-ci.sh build
|
||||||
env:
|
|
||||||
global:
|
matrix:
|
||||||
- PACKAGE=jbuilder
|
include:
|
||||||
matrix:
|
- os: linux
|
||||||
- OCAML_VERSION=4.02 OCAML_RELEASE=3
|
env: OCAML_VERSION=4.02 OCAML_RELEASE=3 WITH_OPAM=0
|
||||||
- OCAML_VERSION=4.03 OCAML_RELEASE=0
|
stage: Build
|
||||||
- OCAML_VERSION=4.04 OCAML_RELEASE=2
|
- os: osx
|
||||||
- OCAML_VERSION=4.05 OCAML_RELEASE=0
|
env: OCAML_VERSION=4.02 OCAML_RELEASE=3 WITH_OPAM=0
|
||||||
os:
|
stage: Build
|
||||||
- linux
|
- os: linux
|
||||||
- osx
|
env: OCAML_VERSION=4.03 OCAML_RELEASE=0 WITH_OPAM=0
|
||||||
|
stage: Build
|
||||||
|
- os: osx
|
||||||
|
env: OCAML_VERSION=4.03 OCAML_RELEASE=0 WITH_OPAM=0
|
||||||
|
stage: Build
|
||||||
|
- os: linux
|
||||||
|
env: OCAML_VERSION=4.04 OCAML_RELEASE=2 WITH_OPAM=0
|
||||||
|
stage: Build
|
||||||
|
- os: osx
|
||||||
|
env: OCAML_VERSION=4.04 OCAML_RELEASE=2 WITH_OPAM=0
|
||||||
|
stage: Build
|
||||||
|
- os: linux
|
||||||
|
env: OCAML_VERSION=4.05 OCAML_RELEASE=0 WITH_OPAM=0
|
||||||
|
stage: Build
|
||||||
|
- os: osx
|
||||||
|
env: OCAML_VERSION=4.05 OCAML_RELEASE=0 WITH_OPAM=0
|
||||||
|
stage: Build
|
||||||
|
- os: linux
|
||||||
|
env: OCAML_VERSION=4.05 OCAML_RELEASE=0 WITH_OPAM=1
|
||||||
|
stage: Test
|
||||||
|
sudo: required
|
||||||
|
|
Loading…
Reference in New Issue