Skip to content

Commit 06c1d85

Browse files
authored
fix travis (#720)
1 parent 54b40a0 commit 06c1d85

File tree

2 files changed

+10
-97
lines changed

2 files changed

+10
-97
lines changed

.travis.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
1-
sudo: required
2-
31
language: c
42

53
matrix:
64
include:
75
- os: linux
8-
env: COMPILER=4.04
6+
env: OCAML_VERSION=4.04
97
- os: linux
10-
env: COMPILER=4.05
8+
env: OCAML_VERSION=4.05
119
- os: linux
12-
env: COMPILER=4.06
10+
env: OCAML_VERSION=4.06
1311
- os: linux
14-
env: COMPILER=4.07
12+
env: OCAML_VERSION=4.07
1513

1614
allow_failures:
1715
- os: linux
18-
env: COMPILER=4.02
16+
env: OCAML_VERSION=4.02
1917
- os: linux
20-
env: COMPILER=4.03
18+
env: OCAML_VERSION=4.03
2119
- os: osx
22-
env: COMPILER=system
20+
env: OCAML_VERSION=system
2321

2422
fast_finish: true
2523

tools/travis.sh

Lines changed: 3 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,10 @@
11
set -x
22

3-
4-
53
# Install system packages.
6-
packages_apt () {
7-
case $COMPILER in
8-
4.02) PPA=avsm/ocaml42+opam12;;
9-
4.03) PPA=avsm/ocaml42+opam12; DO_SWITCH=yes;;
10-
4.04) PPA=avsm/ocaml42+opam12; DO_SWITCH=yes;;
11-
4.05) PPA=avsm/ocaml42+opam12; DO_SWITCH=yes;;
12-
4.06) PPA=avsm/ocaml42+opam12; DO_SWITCH=yes;;
13-
4.07) PPA=avsm/ocaml42+opam12; DO_SWITCH=yes;;
14-
*) echo Unsupported compiler $COMPILER; exit 1;;
15-
esac
16-
17-
sudo add-apt-repository -y ppa:$PPA
18-
sudo apt-get update -qq
19-
20-
if [ -z "$DO_SWITCH" ]
21-
then
22-
sudo apt-get install -qq ocaml-nox
23-
fi
24-
25-
sudo apt-get install -qq opam
26-
27-
}
28-
29-
packages_homebrew () {
30-
brew update > /dev/null
31-
32-
if [ "$COMPILER" = system ]
33-
then
34-
brew install ocaml
35-
# The system compiler on Homebrew is now 4.06 or higher, and there is no
36-
# system Camlp4 package compatible with that (at least not yet). See:
37-
# https://github.com/ocaml/opam-repository/pull/10455
38-
HAVE_CAMLP4=no
39-
else
40-
DO_SWITCH=yes
41-
fi
42-
43-
brew install opam
44-
45-
}
46-
47-
packages_osx () {
48-
case $PACKAGE_MANAGER in
49-
*) packages_homebrew;;
50-
esac
51-
}
52-
53-
packages () {
54-
case $TRAVIS_OS_NAME in
55-
linux) packages_apt;;
56-
osx) packages_osx;;
57-
*) echo Unsupported system $TRAVIS_OS_NAME; exit 1;;
58-
esac
59-
}
4+
wget https://raw.githubusercontent.com/ocaml/ocaml-travisci-skeleton/master/.travis-ocaml.sh
5+
bash -ex .travis-ocaml.sh
606

61-
packages
62-
63-
64-
65-
# Initialize OPAM and switch to the right compiler, if necessary.
66-
case $COMPILER in
67-
4.02) OCAML_VERSION=4.02.3;;
68-
4.03) OCAML_VERSION=4.03.0;;
69-
4.04) OCAML_VERSION=4.04.2;;
70-
4.05) OCAML_VERSION=4.05.0;;
71-
4.06) OCAML_VERSION=4.06.0;;
72-
4.07) OCAML_VERSION=4.07.0;;
73-
system) OCAML_VERSION=`ocamlc -version`;;
74-
*) echo Unsupported compiler $COMPILER; exit 1;;
75-
esac
76-
77-
if [ "$FLAMBDA" = yes ]
78-
then
79-
SWITCH="$OCAML_VERSION+flambda"
80-
else
81-
SWITCH="$OCAML_VERSION"
82-
fi
83-
84-
if [ -n "$DO_SWITCH" ]
85-
then
86-
opam init --compiler=$SWITCH -y -a
87-
else
88-
opam init -y -a
89-
fi
90-
91-
eval `opam config env`
7+
eval $(opam env)
928

939
ACTUAL_COMPILER=`ocamlc -version`
9410
if [ "$ACTUAL_COMPILER" != "$OCAML_VERSION" ]
@@ -97,7 +13,6 @@ then
9713
fi
9814

9915

100-
10116
# Pin Js_of_ocaml, install dependencies, and then install Js_of_ocaml.
10217
# Js_of_ocaml is installed
10318
# separately because we want to keep the build directory for running the tests.

0 commit comments

Comments
 (0)