-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
88 lines (80 loc) · 2.28 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
language: c
dist: trusty
cache:
- apt: true
- bundler: false
- directories:
- $HOME/.local
- $HOME/.opam
- $HOME/Library/Caches/Homebrew
addons:
apt:
packages:
- m4
- git
- rsync
- aspcud
- mecab
- libmecab-dev
- mecab-ipadic-utf8
env:
global:
- PATH=$PATH:$HOME/.local/usr/bin
matrix:
include:
- os: linux
env: OPAM_VERSION=1.2.2 OCAML_VERSION=4.03.0
- os: linux
env: OPAM_VERSION=1.2.2 OCAML_VERSION=4.04.2
- os: linux
env: OPAM_VERSION=1.2.2 OCAML_VERSION=4.05.0 GH_PAGES=1
- os: linux
env: OPAM_VERSION=1.2.2 OCAML_VERSION=4.06.0
- os: linux
env: OPAM_VERSION=1.2.2 OCAML_VERSION=4.07.0+trunk
- os: osx
osx_image: xcode7.3
env: OPAM_VERSION=1.2.2 OCAML_VERSION=4.05.0
allow_failures:
- os: linux
env: OPAM_VERSION=1.2.2 OCAML_VERSION=4.06.0
- os: linux
env: OPAM_VERSION=1.2.2 OCAML_VERSION=4.07.0+trunk
before_script:
- |
if type brew; then
brew update && \
brew install m4 mecab mecab-ipadic
fi
- |
if ! type opam; then
mkdir -p $HOME/.local/usr/bin && \
curl "https://github.com/ocaml/opam/releases/download/$OPAM_VERSION/opam-$OPAM_VERSION-$(uname -m)-$(uname -s)" -Lo $HOME/.local/usr/bin/opam && \
chmod 755 $HOME/.local/usr/bin/opam && \
opam init -a -y --comp $OCAML_VERSION
fi
- eval $(opam config env)
- opam update
- opam install -y ocamlfind 'ounit>=2.0.0' re
script:
- opam lint mecab.opam
- opam pin add -y mecab . --verbose
- ocamlfind query mecab # Check whether ocaml-mecab is installed, or not.
- jbuilder runtest --verbose
- opam remove mecab
# Build API documentation
- |
if [[ "$TRAVIS_PULL_REQUEST" == false ]] && [[ "$TRAVIS_BRANCH" == master ]] && [[ -n "$GH_PAGES" ]]; then
opam install -y odoc
jbuilder build @doc
git clone https://$GITHUB_TOKEN@github.com/akabe/ocaml-mecab.git -b gh-pages gh-pages
rm -rf gh-pages/api
cp *.md gh-pages/
cp -r _build/default/_doc gh-pages/api
cd gh-pages
git add *.md api
git commit --author='Travis CI <travis-ci@example.com>' -m 'Update documentation'
git push origin gh-pages
else
echo -e "\033[33mSkip API documentation builds...\033[0m"
fi