-
Notifications
You must be signed in to change notification settings - Fork 33
/
.travis.yml
168 lines (162 loc) · 5.46 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
sudo: required
dist: bionic
language: cpp
matrix:
include:
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-9
- lcov
- libssl-dev
env:
- MATRIX_EVAL="CC=gcc-9 && CXX=g++-9"
- CMAKE_CXX_STANDARD=11
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-9
- lcov
- libssl-dev
env:
- MATRIX_EVAL="CC=gcc-9 && CXX=g++-9"
- CMAKE_CXX_STANDARD=14
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-9
- lcov
- libssl-dev
env:
- MATRIX_EVAL="CC=gcc-9 && CXX=g++-9"
- CMAKE_CXX_STANDARD=17
- os: linux
addons:
apt:
sources:
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- ubuntu-toolchain-r-test
packages:
- llvm-dev
- libclang-dev
- clang
- lcov
- libssl-dev
env:
- MATRIX_EVAL="CC=clang && CXX=clang++"
- CMAKE_CXX_STANDARD=11
- os: linux
addons:
apt:
sources:
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- ubuntu-toolchain-r-test
packages:
- llvm-dev
- libclang-dev
- clang
- lcov
- libssl-dev
env:
- MATRIX_EVAL="CC=clang && CXX=clang++"
- CMAKE_CXX_STANDARD=14
- os: linux
addons:
apt:
sources:
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- ubuntu-toolchain-r-test
packages:
- llvm-dev
- libclang-dev
- clang
- lcov
- libssl-dev
env:
- MATRIX_EVAL="CC=clang && CXX=clang++"
- CMAKE_CXX_STANDARD=17
- os: osx
osx_image: xcode12.2
env:
- CMAKE_CXX_STANDARD=11
- os: osx
osx_image: xcode12.2
env:
- CMAKE_CXX_STANDARD=14
- os: osx
osx_image: xcode12.2
env:
- CMAKE_CXX_STANDARD=17
git:
depth: 1
before_install:
- eval "${MATRIX_EVAL}"
# Dependencies required by the CI are installed in ${TRAVIS_BUILD_DIR}/deps/
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir -p "${DEPS_DIR}"
- cd "${DEPS_DIR}"
############################################################################
# Install a recent CMake (unless already installed on OS X)
############################################################################
- CMAKE_VERSION=3.15.4
- |
if [ ${TRAVIS_OS_NAME} == linux ]; then
CMAKE_URL="https://cmake.org/files/v${CMAKE_VERSION%.[0-9]}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz"
mkdir cmake && travis_retry wget --no-check-certificate -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
sudo apt-get update
git clone https://github.com/open-source-parsers/jsoncpp.git ~/jsoncpp
export BLD_PATH=`pwd`; cd ~/jsoncpp; mkdir build && cd build
cmake -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} -DJSONCPP_WITH_TESTS=OFF -DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release ..
make && sudo make install && cd $BLD_PATH
else
brew update
brew install openssl --force
brew install jsoncpp lcov
brew install cmake || brew upgrade cmake
fi
before_script:
- cd ${TRAVIS_BUILD_DIR}
- git submodule update --init --recursive
- mkdir build-debug && cd build-debug
- |
if [ $TRAVIS_OS_NAME == osx ]; then
cmake -Wno-dev -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} -DCMAKE_BUILD_TYPE=Debug -DJWTPP_WITH_COVERAGE=ON -DJWTPP_WITH_TESTS=ON -DJWTPP_WITH_SHARED_LIBS=ON -DOPENSSL_ROOT_DIR=$(brew --prefix openssl) -DCMAKE_INSTALL_PREFIX=/usr/local ..
else
cmake -Wno-dev -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} -DCMAKE_BUILD_TYPE=Debug -DJWTPP_WITH_COVERAGE=ON -DJWTPP_WITH_TESTS=ON -DJWTPP_WITH_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr/local ..
fi
- cd .. && mkdir build-release && cd build-release
- |
if [ $TRAVIS_OS_NAME == osx ]; then
cmake -Wno-dev -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} -DCMAKE_BUILD_TYPE=Release -DJWTPP_WITH_TESTS=ON -DJWTPP_WITH_SHARED_LIBS=ON -DOPENSSL_ROOT_DIR=$(brew --prefix openssl) -DCMAKE_INSTALL_PREFIX=/usr/local ..
else
cmake -Wno-dev -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} -DCMAKE_BUILD_TYPE=Release -DJWTPP_WITH_TESTS=ON -DJWTPP_WITH_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr/local ..
fi
script:
- make
- mkdir -p tests
- ./jwtpp_test
- sudo make install
- cd ../build-debug
- make
- mkdir -p tests
- ./jwtpp_test
after_success:
# Create lcov report
- lcov --capture --directory . --output-file coverage.info
- lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter system-files
- lcov --list coverage.info # debug info
# Uploading report to CodeCov
- bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"