-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
135 lines (118 loc) · 3.88 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
branches:
only:
- master
- develop
- travis
language: shell
sudo: required
addons:
homebrew:
brewfile: true
update: true
stages:
- build
- test
jobs:
include:
- stage: build
language: cpp
os: linux
dist: xenial
env: BUILD_TYPE=Debug
before_install: &setup_brew
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
export PREFIX=/usr/local;
echo $(which brew);
echo $PATH;
fi
# Set linuxbrew paths
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
export PREFIX=/home/linuxbrew/.linuxbrew;
export PATH=$PREFIX/bin:$PREFIX/sbin:$PATH;
export MANPATH=$PREFIX/share/man:$MANPATH;
export INFOPATH=$PREFIX/share/info:$INFOPATH;
fi
# Set prefix search path to homebrew folder for library discovery
- GENERATOR_ARGS="$GENERATOR_ARGS -DCMAKE_PREFIX_PATH=$PREFIX;${CMAKE_PREFIX_PATH}"
install: &download_deps
# Output something every 10 minutes or Travis kills the job
- while sleep 9m; do echo "=====[ $SECONDS seconds still running ]====="; done &
# Install linuxbrew
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)";
hash -r;
echo $(which brew);
echo $PATH;
brew update;
brew bundle || true;
fi
# Kill background sleep loop
- kill %1
- brew list -1 | while read line; do brew unlink $line; brew link $line; done
script: &build_lib
# Set installation prefix
- GENERATOR_ARGS="$GENERATOR_ARGS -DCMAKE_INSTALL_PREFIX=$TRAVIS_BUILD_DIR/install"
# Shared and static libraries
- GENERATOR_ARGS="$GENERATOR_ARGS -DBUILD_SHARED=ON -DBUILD_STATIC=ON -DBUILD_DRAFTS=ON"
# Build and install project
- cmake -H$TRAVIS_BUILD_DIR -B$TRAVIS_BUILD_DIR/build $GENERATOR_ARGS
- cmake --build $TRAVIS_BUILD_DIR/build --config $BUILD_TYPE
- pushd $TRAVIS_BUILD_DIR/build
- ctest -C $BUILD_TYPE --output-on-fail --no-compress-output -T Test --timeout 320
#- cmake --build $TRAVIS_BUILD_DIR/build --target install --BUILD_TYPE $BUILD_TYPE
cache:
directories: &cache_build
- $HOME/Library/Caches/Homebrew
- /usr/local/Cellar
- /home/linuxbrew/.linuxbrew
- $TRAVIS_BUILD_DIR/build
- $TRAVIS_BUILD_DIR/install
- stage: build
language: cpp
os: linux
dist: xenial
env: BUILD_TYPE=Release
before_install: *setup_brew
install: *download_deps
script: *build_lib
cache:
directories: *cache_build
- stage: build
language: cpp
os: osx
osx_image: xcode10.1
env: BUILD_TYPE=Debug
before_install: *setup_brew
script: *build_lib
cache:
directories: *cache_build
- stage: build
language: cpp
os: osx
osx_image: xcode10.1
env: BUILD_TYPE=Release
before_install: *setup_brew
script: *build_lib
cache:
directories: *cache_build
- stage: test
dist: xenial
language: python
env: BUILD_TYPE=Release
script:
- GENERATOR_ARGS="$GENERATOR_ARGS -DBINDINGS_PYTHON=ON -DBINDINGS_PYTHON_TESTS=ON"
- cmake -H$TRAVIS_BUILD_DIR -B$TRAVIS_BUILD_DIR/build -G "$GENERATOR" $GENERATOR_ARGS
- cmake --build $TRAVIS_BUILD_DIR/build --target install --config $BUILD_TYPE
- pushd $TRAVIS_BUILD_DIR/build
- ctest -C $BUILD_TYPE --output-on-fail --no-compress-output -T Test --timeout 320
- stage: test
dist: xenial
language: ruby
env: BUILD_TYPE=Release
- stage: test
dist: xenial
language: csharp
env: BUILD_TYPE=Release
homebrew:
casks:
- dotnet-sdk