-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
113 lines (101 loc) · 3.38 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
---
language: crystal
sudo: required
matrix:
include:
# FIXME: disabled because Travis CI doesn't provide a working Crystal image anymore
# (see https://github.com/travis-ci/travis-build/pull/1987)
#
## Linux
#- os: linux
# dist: xenial
#- os: linux
# dist: bionic
- os: linux
dist: bionic
language: minimal
install: ~
before_script: ~
env: GENERATE_LIB=1 # regenerate the binding
script:
- docker-compose build devel
- docker-compose run --rm -u $UID devel sh -c
"make clean
&& make
&& crystal tool format --check src spec bench
&& crystal spec
&& make benchmark"
# macOS
# FIXME: builds on macOS are disabled because it's not possible to use
# "brew link" with the icu4c formula anymore which makes compilation
# fail for some reason (Crystal macro run doesnt seems to take in
# account compiler env. var. correctly).
# The library is not yet compatible with ICU version shipped with macOS.
#- os: osx
# osx_image: xcode11.2
#- os: osx
# osx_image: xcode11.2
# env: GENERATE_LIB=1 # regenerate the binding
# FIXME: disabled because Travis CI doesn't provide a working Crystal image anymore
# (see https://github.com/travis-ci/travis-build/pull/1987)
#
## publish the documentation on GitHub pages
#- os: linux
# stage: deploy
# install:
# script: crystal docs
# deploy:
# provider: pages
# local_dir: docs/
# target_branch: gh-pages
# github_token: $GITHUB_TOKEN
# skip_cleanup: true
# on:
# branch: master
install: |
set -e
set -x
case $TRAVIS_OS_NAME in
linux)
sudo apt-get -qq update
if [[ -n $GENERATE_LIB ]]; then
sudo apt-get install -y llvm-3.8-dev libclang-3.8-dev
# FIXME: ugly fix since the libclang-3.8-dev package is bugged
sudo ln -s $(llvm-config-3.8 --libdir)/libclang.so /usr/lib/
fi
sudo apt-get install -y libicu-dev
;;
osx)
export HOMEBREW_NO_AUTO_UPDATE=1
if [[ -n $GENERATE_LIB ]]; then
# install LLVM and Clang 4 (a libgen dependency)
brew install llvm@7
brew link --force --overwrite llvm@7
# FIXME: the "libclang.dylib" shared object is manually added to the ld
# library path since the llvm the formula don't do it properly
find $(brew --prefix llvm@7)/lib -type f -name "libclang.dylib" -exec ln -sf {} $(brew --prefix)/lib \; -quit
fi
# install or upgrade icu4c
brew ls --versions icu4c && brew upgrade icu4c || brew install icu4c
ICU_VERSION=$(brew ls --versions icu4c | tail -1 | awk '{print $2}')
ICU_CELLAR_DIR=$(brew --cellar icu4c)/$ICU_VERSION
# since version 1.9.0, "brew link" does not work for software
# already provided by macOS anymore
brew switch icu4c $ICU_VERSION
# make sure that ICU executables are added to the PATH
# and that the shared objects files can be found by the linker
export PATH="$ICU_CELLAR_DIR/bin:$PATH"
export DYLD_FALLBACK_LIBRARY_PATH="$ICU_CELLAR_DIR/lib:$DYLD_FALLBACK_LIBRARY_PATH"
export PKG_CONFIG_PATH="$ICU_CELLAR_DIR/lib/pkgconfig:$PKG_CONFIG_PATH"
;;
*)
exit 1;;
esac
set +x
before_script:
- crystal run src/icu_info.cr -- --version # displays the version of ICU
- "[ -z $GENERATE_LIB ] || { make clean; make ;}"
script:
crystal tool format --check src spec bench
&& crystal spec
&& make benchmark