-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
169 lines (157 loc) · 4.7 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# Enable Lang
language: cpp
# Matrix
matrix:
include:
# Windows msvc Release
- name: "Windows Release"
os: windows
env:
- CONAN_SETTINGS_FLAG="-g cmake -s compiler=\"Visual Studio\" -s compiler.version=15 -s arch=x86_64 -s build_type=Release -b missing"
- CMAKE_GENERATOR_FLAG="-G \"Visual Studio 15 2017\" -DCMAKE_GENERATOR_PLATFORM=x64"
- BUILD_CONFIG=Release
- DEPLOY_EXE=Windows_x64.zip
cache:
directories:
- $HOME/.conan/data
# Windows msvc Debug
- name: "Windows Debug"
os: windows
env:
- CONAN_SETTINGS_FLAG="-g cmake -s compiler=\"Visual Studio\" -s compiler.version=15 -s arch=x86_64 -s build_type=Debug -b missing"
- CMAKE_GENERATOR_FLAG="-G \"Visual Studio 15 2017\" -DCMAKE_GENERATOR_PLATFORM=x64"
- BUILD_CONFIG=Debug
- DEPLOY_EXE=Windows_x64.zip
cache:
directories:
- $HOME/.conan/data
# MacOS clang Release
- name: "MacOS Release"
os: osx
osx_image: xcode10
env:
- compiler=clang
- COMPILER_CC=clang
- COMPILER_CXX=clang++
- CONAN_SETTINGS_FLAG="-g cmake -s build_type=Release -b missing"
- CMAKE_GENERATOR_FLAG=""
- BUILD_CONFIG=Release
- DEPLOY_EXE=OSX_x64.zip
cache:
directories:
- $HOME/.conan/data
# MacOS clang Debug
- name: "MacOS Debug"
os: osx
osx_image: xcode10
env:
- compiler=clang
- COMPILER_CC=clang
- COMPILER_CXX=clang++
- CONAN_SETTINGS_FLAG="-g cmake -s build_type=Debug -b missing"
- CMAKE_GENERATOR_FLAG=""
- BUILD_CONFIG=Debug
- DEPLOY_EXE=OSX_x64.zip
cache:
directories:
- $HOME/.conan/data
# Linux gcc Release
- name: "Linux Release"
os: linux
dist: xenial
env:
- COMPILER=g++-8
- COMPILER_CC=gcc-8
- COMPILER_CXX=g++-8
- CONAN_SETTINGS_FLAG="-g cmake -s build_type=Release -s compiler.libcxx=libstdc++11 -b missing"
- CMAKE_GENERATOR_FLAG="-G \"Unix Makefiles\""
- BUILD_CONFIG=Release
- DEPLOY_EXE=Linux_x64.zip
# cache:
# directories:
# - $HOME/.conan/data
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['gcc-8', 'g++-8' ]
# Linux gcc Debug
- name: "Linux Debug"
os: linux
dist: xenial
env:
- COMPILER=g++-8
- COMPILER_CC=gcc-8
- COMPILER_CXX=g++-8
- CONAN_SETTINGS_FLAG="-g cmake -s build_type=Debug -s compiler.libcxx=libstdc++11 -b missing"
- CMAKE_GENERATOR_FLAG="-G \"Unix Makefiles\""
- BUILD_CONFIG=Debug
- DEPLOY_EXE=Linux_x64.zip
# cache:
# directories:
# - $HOME/.conan/data
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['gcc-8', 'g++-8' ]
allow_failures:
- os: osx
- os: linux
fast_finish: true
# The pre-install script. On windows it will install conan via chocolatey
before_install:
- |
if [[ "${TRAVIS_OS_NAME}" == "windows" ]]; then
choco install python3 --version 3.7.4
export PATH="/c/Python37:/c/Python37/Scripts:$PATH"
python -m pip install --upgrade pip
fi
install:
- |
if [[ "${TRAVIS_OS_NAME}" == "windows" ]]; then
pip install conan
else
pip install --user --upgrade pip
pip install --user conan --upgrade
fi
# Setup Build
before_script:
# The path to conan does not get set properly because travis does not restart the shell
# so we ahve to manually add the path it on Windows.
- if [[ "${TRAVIS_OS_NAME}" == "windows" ]]; then export PATH=$PATH:/c/Program\ Files/Conan/conan; fi
- if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then export PATH=$PATH:/Users/travis/Library/Python/2.7/bin; fi
- if [ -f conanfile.txt ]; then export USE_CONAN=TRUE; fi
- if [[ "${USE_CONAN}" == "TRUE" ]]; then conan user; fi
- if [[ "${USE_CONAN}" == "TRUE" ]]; then conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan; fi
- if [[ "${COMPILER_CXX}" != "" ]]; then export CXX=${COMPILER_CXX}; fi
- if [[ "${COMPILER_CC}" != "" ]]; then export CC=${COMPILER_CC}; fi
# Build and Test
script:
# Import Environment
- env
# Conan Build
- mkdir conan && cd conan
- if [[ "${USE_CONAN}" == "TRUE" ]]; then eval conan install .. ${CONAN_SETTINGS_FLAG}; fi
- cd ..
# Cmake Build
- mkdir build && cd build
- eval cmake .. ${CMAKE_GENERATOR_FLAG}
- eval cmake --build . --config ${BUILD_CONFIG}
# Check dir
before_deploy:
- |
if [[ "${TRAVIS_OS_NAME}" == "windows" ]]; then
echo
else
pwd
ls bin/
zip -r ${DEPLOY_EXE} bin/*
fi
# Deploy to github
deploy:
provider: releases
api_key: ${GITHUB_TOKEN}
file: ${DEPLOY_EXE}
skip_cleanup: true
on:
tags: true
condition: "$BUILD_CONFIG = Release"