forked from Snaipe/Criterion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
185 lines (166 loc) · 4.5 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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
language: c
sudo: false
_packages:
- &gcc49-packages
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.9
- g++-4.9
_stylecheck: &stylecheck
compiler: uncrustify
language: cpp
before_install:
- if [[ "$TRAVIS_PULL_REQUEST" == false ]]; then exit 0; fi
- ./.cmake/install-uncrustify.sh
- export PATH="$PATH:$HOME/bin"
- >
export SOURCES=$(find src include test samples \( \
-type f \( \
-iname "*.c" -or \
-iname "*.h" -or \
-iname "*.cc" -or \
-iname "*.hxx" \
\) -and -not \
-iname "*.pb.*" \))
- export STYLE_OK=true
script:
- >
for f in $SOURCES; do
if ! uncrustify -q --check -c .uncrustify.cfg $f; then
uncrustify -q -c .uncrustify.cfg -f $f | git --no-pager diff --no-index --color=always $f -
export STYLE_OK=false
fi
done
- $STYLE_OK
after_success:
- echo "Style check passed."
matrix:
include:
- *stylecheck
# Linux Debug, GCC 4.9
- os: linux
compiler: gcc-4.9
addons: *gcc49-packages
env:
- CONFIGURATION=Debug
- COVERAGE=ON
# Linux RelWithDebInfo, GCC 4.9
- os: linux
compiler: gcc-4.9
addons: *gcc49-packages
env:
- CONFIGURATION=RelWithDebInfo
- DEPLOY=true
# Coverity token
- secure: >-
n6BHG86ISeYSAVE/i7m1K+XVW0j8PrJ5JxoJwhAGBb1
hkCn9sWybGo1HzZsf7rxpkQh/5Va4i+eyOrUt7VWAuF
EJN2+mEWqERkWZxiXrS3N9xi74cPFI79eDOTFnPm13e
diUX8Ts+IuFy890+tsNHqkEn055l6yOVMtj1LWWtRs=
# Linux Debug, GCC 4.6
- os: linux
compiler: gcc
env: CONFIGURATION=Debug
# Linux RelWithDebInfo, GCC 4.6
- os: linux
compiler: gcc
env: CONFIGURATION=RelWithDebInfo
# OSX Debug, GCC 4.9
- os: osx
osx_image: xcode8
compiler: gcc-4.9
env:
- CONFIGURATION=Debug
- GCOV=gcov-4.9
- COVERAGE=ON
# OSX RelWithDebInfo, GCC 4.9
- os: osx
osx_image: xcode8
compiler: gcc-4.9
env: CONFIGURATION=RelWithDebInfo
# OSX Debug, Clang
- os: osx
compiler: clang
env: CONFIGURATION=Debug
# OSX RelWithDebInfo, Clang
- os: osx
compiler: clang
env:
- CONFIGURATION=RelWithDebInfo
- DEPLOY=true
allow_failures:
- compiler: gcc
before_install:
- |
if [ "${TESTS:-ON}" = "ON" ]; then
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
export PATH="$(python2 -m site --user-base)/bin:$PATH"
fi
travis_retry pip2 install --user cram==0.7
fi
- export CXX=${CC/gcc/g++}; export CXX=${CXX/clang/clang++}
- $CC --version
- $CXX --version
script:
- mkdir -p build && cd $_
- >
cmake
-Wno-dev
-DCTESTS=${TESTS:-ON}
-DCOVERALLS=${COVERAGE:-OFF}
-DCMAKE_BUILD_TYPE=${CONFIGURATION}
-DCMAKE_INSTALL_PREFIX=criterion-${TRAVIS_TAG}
${CMAKE_OPTS}
..
- |
if [ "${TESTS:-ON}" = "ON" ]; then
TERM=dumb cmake --build . --target criterion_tests -- -j4
ctest --output-on-failure -j4 --timeout=20
else
TERM=dumb cmake --build . -- -j4
fi
after_success:
- |
if [ "$COVERAGE" = "ON" ]; then
make gcov
bash <(curl -s https://codecov.io/bash)
fi
before_deploy:
- make install
- tar -cvjf ../criterion-${TRAVIS_TAG}-${TRAVIS_OS_NAME}-x86_64.tar.bz2 criterion-${TRAVIS_TAG}
- cd ..
- |
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
brew install gnu-tar --with-default-names
export PATH="/usr/local/bin:$PATH"
fi
- ./.cmake/git-archive-all.sh --prefix criterion-${TRAVIS_TAG} criterion-${TRAVIS_TAG}.tar && bzip2 $_
addons:
coverity_scan:
project:
name: "Snaipe/Criterion"
description: "A KISS, Cross-platform C unit testing framework"
notification_email: [email protected]
build_command_prepend: "cmake ."
build_command: "make -j4"
branch_pattern: coverity_scan
deploy:
provider: releases
edge:
branch: releases-fix
skip_cleanup: true
file:
- criterion-${TRAVIS_TAG}-${TRAVIS_OS_NAME}-x86_64.tar.bz2
- criterion-${TRAVIS_TAG}.tar.bz2
on:
repo: Snaipe/Criterion
tags: true
condition: $DEPLOY = true
api_key:
secure: >-
d3l2Ohb2FF3tSXku1d0ASR5dntdnQ48Jyc39IEloDBx
FXCselCkYruUQv6p0TA3P+Dmrz4wS7/AFlBMMsQ3XfG
FVIOnITiTaGWg5fEpIf7zYsDf0zECPE0MOHMGqJMn3/
SrSKdtEA4N84Q4JS7Ou+ewG65mxUDO5Ce60OoEG5JA=