Skip to content

Commit

Permalink
CI: use container-based infrastructure and add CHANGE and TEST option…
Browse files Browse the repository at this point in the history
…al checks

The optional checks have been written by @gasche
  • Loading branch information
samoht committed Nov 27, 2015
1 parent 647a8cc commit 1d2e0cf
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 24 deletions.
75 changes: 53 additions & 22 deletions .travis-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,57 @@
# #
#########################################################################

case $XARCH in
i386)
./configure
make world.opt
sudo make install
(cd testsuite && make all)
mkdir external-packages
cd external-packages
git clone git://github.com/ocaml/camlp4
(cd camlp4 && ./configure && make && sudo make install)
git clone git://github.com/ocaml/opam
(cd opam && ./configure && make lib-ext && make && sudo make install)
git config --global user.email "some@name.com"
git config --global user.name "Some Name"
opam init -y -a git://github.com/ocaml/opam-repository
opam install -y oasis
# opam pin add -y utop git://github.com/diml/utop
;;
*)
echo unknown arch
exit 1
;;
PREFIX=~/local

BuildAndTest () {
case $XARCH in
i386)
mkdir -p $PREFIX
./configure --prefix $PREFIX
export PATH=$PREFIX/bin:$PATH
make world.opt
make install
(cd testsuite && make all)
mkdir external-packages
cd external-packages
git clone git://github.com/ocaml/camlp4
(cd camlp4 &&
./configure --bindir=$PREFIX/bin --libdir=$PREFIX/lib/ocaml \
--pkgdir=$PREFIX/lib/ocaml && \
make && make install)
git clone git://github.com/ocaml/opam
(cd opam && ./configure --prefix $PREFIX &&\
make lib-ext && make && make install)
git config --global user.email "some@name.com"
git config --global user.name "Some Name"
opam init -y -a git://github.com/ocaml/opam-repository
opam install -y oasis
# opam pin add -y utop git://github.com/diml/utop
;;
*)
echo unknown arch
exit 1
;;
esac
}

CheckChangesModified () {
# check that Changes has been modified by the proposed change
git diff $TRAVIS_COMMIT_RANGE --name-only --exit-code Changes > /dev/null \
&& exit 1 || echo pass
}

CheckTestsuiteModified () {
# check that testsuite/ has been modified by the proposed change
git diff $TRAVIS_COMMIT_RANGE --name-only --exit-code testsuite > /dev/null \
&& exit 1 || echo pass
}

case $CI_KIND in
build) BuildAndTest;;
changes) CheckChangesModified;;
tests) CheckTestsuiteModified;;
*) echo unknown CI kind
exit 1
;;
esac
11 changes: 9 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@
# #
#########################################################################

sudo: false
language: c
script: bash -ex .travis-ci.sh
env:
- XARCH=i386
matrix:
include:
- env: CI_KIND=build XARCH=i386
- env: CI_KIND=changes
- env: CI_KIND=tests
allow_failures:
- env: CI_KIND=changes
- env: CI_KIND=tests

0 comments on commit 1d2e0cf

Please sign in to comment.