Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 28 additions & 10 deletions .travis-ocaml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,32 @@ full_apt_version () {

set -uex


# the ocaml version to test
OCAML_VERSION=${OCAML_VERSION:-latest}
OPAM_VERSION=${OPAM_VERSION:-2.0.0}
OPAM_INIT=${OPAM_INIT:-true}

if [ "${INSTALL_LOCAL+x}" = x ] ; then
if [ "$TRAVIS_OS_NAME" = osx ] ; then
echo INSTALL_LOCAL not permitted for macOS targets
exit 1
fi

if [ "${OPAM_SWITCH:=system}" != system ] ; then
echo "INSTALL_LOCAL requires OPAM_SWITCH=system (or unset/null)"
exit 1
fi
case ${OPAM_VERSION} in
2.0.0)
if [ "${OPAM_SWITCH:=ocaml-system}" != ocaml-system ] ; then
echo "INSTALL_LOCAL requires OPAM_SWITCH=ocaml-system (or unset/null)"
exit 1
fi ;;
*)
if [ "${OPAM_SWITCH:=system}" != system ] ; then
echo "INSTALL_LOCAL requires OPAM_SWITCH=system (or unset/null)"
exit 1
fi ;;
esac
fi

# the ocaml version to test
OCAML_VERSION=${OCAML_VERSION:-latest}
OPAM_VERSION=${OPAM_VERSION:-2.0.0}
OPAM_INIT=${OPAM_INIT:-true}

# the base opam repository to use for bootstrapping and catch-all namespace
case $OPAM_VERSION in
2.0.0) BASE_REMOTE=${BASE_REMOTE:-git://github.com/ocaml/opam-repository#2.0.0} ;;
Expand Down Expand Up @@ -81,6 +90,13 @@ install_ppa () {
fi
}

install_ocaml () {
sudo apt-get install -y \
ocaml ocaml-base ocaml-native-compilers ocaml-compiler-libs \
ocaml-interp ocaml-base-nox ocaml-nox \
camlp4 camlp4-extra
}

install_on_linux () {
case "$OCAML_VERSION,$OPAM_VERSION" in
3.12,1.2.2)
Expand All @@ -106,6 +122,7 @@ install_on_linux () {
4.01,2.0.0)
OCAML_FULL_VERSION=4.01.0
OPAM_SWITCH=${OPAM_SWITCH:-ocaml-system}
install_ocaml ;
install_opam2 ;;
4.02,1.1.2)
OCAML_FULL_VERSION=4.02.3
Expand Down Expand Up @@ -234,7 +251,8 @@ install_on_osx () {
4.06,2.0.0) OCAML_FULL_VERSION=4.06.1; install_opam2 ;;
4.07,1.2.2) OCAML_FULL_VERSION=4.07.0;
OPAM_SWITCH=${OPAM_SWITCH:-system};
brew install ocaml; brew install opam ;;
brew install ocaml;
brew install opam ;;
4.07,2.0.0) OCAML_FULL_VERSION=4.07.0;
OPAM_SWITCH=${OPAM_SWITCH:-ocaml-system};
brew install ocaml;
Expand Down
3 changes: 2 additions & 1 deletion src/ci_opam.ml
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ let lint_pins pkg pins =
;; (* Go go go *)

with_fold "Prepare" (fun () ->
set "-ue";
set "-uex";
unset "TESTS";
export "OPAMYES" "1";
?| "eval $(opam config env)";
Expand Down Expand Up @@ -261,6 +261,7 @@ with_fold "Prepare" (fun () ->
| _ -> ?|~ "opam lint %s" opam);
let pins = lint_pins pkg pins in
List.iter pin pins;
?|~ "echo %s are pinned" (String.concat ", " (List.map fst pins));
?| "eval $(opam config env)";
?| "opam install depext";
(* Install the external dependencies *)
Expand Down