forked from ocaml/odoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
141 lines (129 loc) · 2.99 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
language: generic
sudo: required
scripts:
- &opam
before_install:
- |
if [ "$TRAVIS_EVENT_TYPE" == cron ]
then
rm -rf ~/.opam ./_opam ./_cache
fi
install:
- |
if [ "$TIDY" == YES ]
then
sudo add-apt-repository -y ppa:robert7/tidy-html5
sudo apt-get update
sudo apt-get install tidy
tidy --version
fi
- OPAM_RELEASES=https://github.com/ocaml/opam/releases/
- OPAM_VERSION=2.0.5
- |
case $TRAVIS_OS_NAME in
"linux") OPAM_OS=linux;;
"osx") OPAM_OS=macos;;
*) echo Unsupported system $TRAVIS_OS_NAME; exit 1;;
esac
- OPAM_PKG=opam-${OPAM_VERSION}-x86_64-${OPAM_OS}
- wget ${OPAM_RELEASES}/download/${OPAM_VERSION}/${OPAM_PKG}
- sudo mv ${OPAM_PKG} /usr/local/bin/opam
- sudo chmod a+x /usr/local/bin/opam
- opam init -y --bare --disable-sandboxing
- |
if [ ! -d _opam/bin ]
then
rm -rf _opam
opam switch create . $OCAML $REPOSITORIES --no-install
fi
- eval `opam env`
- opam install -y --deps-only .
- opam --version
- ocaml -version
before_script:
- rm -rf ./_build/default/test/html/_scratch
script:
- |
if [ -d _cache/_build ]
then
cp -r _cache/_build .
fi
- make test
- make docs
- |
if [ ! -d _cache/_build ]
then
cp -r _build _cache
fi
before_cache:
- opam clean
- rm -rf /home/travis/build/ocaml/odoc/_opam/.opam-switch/sources/odoc
- &esy
before_install:
- |
if [ "$TRAVIS_EVENT_TYPE" == cron ]
then
rm -rf ~/.esy ./_cache
fi
install:
- npm --global install [email protected]
- $(npm bin --global)/esy --version
- ESY=$(npm bin --global)/esy
- $ESY install --verbose
script:
- |
if [ -d _cache/_build ]
then
cp -r _cache/_build .
fi
- $ESY build --verbose
- $ESY make test
- |
if [ ! -d _cache/_build ]
then
cp -r _build _cache
fi
matrix:
include:
- <<: *esy
os: osx
env: ESY_BUILD=YES ESY__CACHE=/home/travis/.esy
- <<: *esy
os : linux
env: ESY_BUILD=YES ESY__CACHE=/home/travis/.esy
- <<: *opam
os: osx
env: OCAML=4.08.1
- <<: *opam
os: linux
env: OCAML=4.09.0 TIDY=YES
- <<: *opam
os: linux
env: OCAML=4.07.1
- <<: *opam
os: linux
env: OCAML=4.06.1
- <<: *opam
os: linux
env: OCAML=4.05.0
- <<: *opam
os: linux
env: OCAML=4.04.2
- <<: *opam
os: linux
env: OCAML=4.03.0
- <<: *opam
os: linux
env: OCAML=4.02.3
fast_finish: true
cache:
directories:
- $HOME/.opam
- $HOME/.esy
- $HOME/.nvm
- ./_opam
- ./_cache
notifications:
email:
on_success: always
on_failure: always