forked from cmuparlay/parlaylib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
214 lines (188 loc) · 6.73 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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
os: linux
dist: bionic
language: cpp
env: PARLAY_NUM_THREADS=8
stages:
- test
- analysis
- sanitize
- report
addons:
apt:
update: true
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
packages:
- g++-7
- g++-9
- clang-10
- libomp-10-dev
- libtbb-dev
- libc++1-10
- libc++abi1-10
- libc++-10-dev
- libc++abi-10-dev
homebrew:
update: false
packages:
- gcc@9
before_script:
# Install the latest CMake
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
wget --quiet https://github.com/Kitware/CMake/releases/download/v3.18.2/cmake-3.18.2-Linux-x86_64.tar.gz
tar -xf cmake-3.18.2-Linux-x86_64.tar.gz
export PATH=$PWD/cmake-3.18.2-Linux-x86_64/bin/:$PATH
fi
jobs:
include:
# -------------------------------------------------------------------------
# TEST STAGE
# -------------------------------------------------------------------------
# Test that the project builds and tests successfully with GCC
- stage: test
name: check-gcc
script:
- mkdir build
- cd build
- CC=gcc-9 CXX=g++-9 cmake -DCMAKE_BUILD_TYPE=Debug -DPARLAY_TEST=On -DPARLAY_TEST_OMP=On -DPARLAY_TEST_TBB=On -DPARLAY_BENCHMARK=On ..
- make
- ctest --no-tests=error
# Test that the project builds and tests successfully with Clang
- stage: test
name: check-clang
script:
- mkdir build
- cd build
- CC=clang-10 CXX=clang++-10 cmake -DCMAKE_BUILD_TYPE=Debug -DPARLAY_TEST=On -DPARLAY_TEST_OMP=On -DPARLAY_TEST_TBB=On -DPARLAY_BENCHMARK=On ..
- make
- ctest --no-tests=error
# Test that the project builds and tests successfully with Clang using libc++
- stage: test
name: check-clang-libcxx
script:
- mkdir build
- cd build
- CC=clang-10 CXX=clang++-10 cmake -DCMAKE_BUILD_TYPE=Debug -DPARLAY_TEST=On -DUSE_LIBCXX=On -DPARLAY_TEST_OMP=On -DPARLAY_TEST_TBB=On -DPARLAY_BENCHMARK=On ..
- make
- ctest --no-tests=error
# Test that the project builds and tests successfully with GCC 7 (with Cilk support)
- stage: test
name: check-gcc-cilk
script:
- mkdir build
- cd build
- CC=gcc-7 CXX=g++-7 cmake -DCMAKE_BUILD_TYPE=Debug -DPARLAY_TEST=On -DPARLAY_TEST_CILK=On ..
- make
- ctest --no-tests=error
# Test that the project builds and tests successfully on OSX with GCC
- stage: test
name: check-apple-gcc
os: osx
osx_image: xcode12u
script:
- mkdir build
- cd build
- CXX=g++-9 cmake -DCMAKE_BUILD_TYPE=Debug -DPARLAY_TEST=On ..
- make
- ctest --no-tests=error
# Test that the project builds and tests successfully on OSX with Apple Clang
- stage: test
name: check-apple-clang
os: osx
osx_image: xcode12u
script:
- mkdir build
- cd build
- cmake -DCMAKE_BUILD_TYPE=Debug -DPARLAY_TEST=On ..
- make
- ctest --no-tests=error
# -------------------------------------------------------------------------
# ANALYSIS STAGE
# -------------------------------------------------------------------------
# Run CppCheck on the codebase
- stage: analysis
name: cppcheck
script:
# Download, build, and install cppcheck
- wget --quiet https://github.com/danmar/cppcheck/archive/2.1.tar.gz
- tar -xf 2.1.tar.gz
- mkdir cppcheck-2.1/build && pushd cppcheck-2.1/build
- CC=clang-10 CXX=clang++-10 cmake .. -DCMAKE_BUILD_TYPE=Release
- make && sudo make install
- popd
# Run the analysis
- mkdir build
- cd build
- CC=clang-10 CXX=clang++-10 cmake -DENABLE_CPPCHECK=On ..
- make cppcheck-all
# Run clang-tidy on the codebase
- stage: analysis
name: clang-tidy
script:
# Install clang-tidy
- sudo apt-get -qq install clang-tidy-10
- sudo ln -s /usr/bin/clang-tidy-10 /usr/bin/clang-tidy
# Run the analysis
- mkdir build
- cd build
- CC=clang-10 CXX=clang++-10 cmake -DENABLE_CLANG_TIDY=On ..
- make clang-tidy-all
# Run include-what-you-use on the codebase
- stage: analysis
name: include-what-you-use
script:
# Install clang and llvm development files
- sudo apt-get -qq install clang-10 libc++1-10 libc++-10-dev libc++abi1-10 libc++abi-10-dev llvm-10-dev libclang-10-dev
# Download, build, and install IWYU
- git clone https://github.com/include-what-you-use/include-what-you-use.git
- mkdir include-what-you-use/build && pushd include-what-you-use/build
- git checkout clang_10
- cmake -DCMAKE_PREFIX_PATH=/usr/lib/llvm-10 ..
- make && sudo make install
- popd
# Run the analysis
- mkdir build
- cd build
- CC=clang-10 CXX=clang++-10 cmake -DENABLE_IWYU=On ..
- make iwyu-all
# -------------------------------------------------------------------------
# SANITIZE STAGE
# -------------------------------------------------------------------------
# Run the tests with AddressSanitizer instrumentation
- stage: sanitize
name: check-asan
script:
- mkdir build
- cd build
- CC=clang-10 CXX=clang++-10 cmake -DCMAKE_BUILD_TYPE=Debug -DPARLAY_TEST=On -DBUILD_ASAN_TESTS=On -DUSE_LIBCXX=On ..
- make
- ctest --no-tests=error -R -asan
# Run the tests with UndefinedBehaviorSanitizer instrumentation
- stage: sanitize
name: check-ubsan
script:
- mkdir build
- cd build
- CC=clang-10 CXX=clang++-10 cmake -DCMAKE_BUILD_TYPE=Debug -DPARLAY_TEST=On -DBUILD_UBSAN_TESTS=On -DUSE_LIBCXX=On ..
- make
- ctest --no-tests=error -R -ubsan
# -------------------------------------------------------------------------
# REPORT STAGE
# -------------------------------------------------------------------------
# Report code coverage results to codecov.io
- stage: report
name: code-coverage
script:
- sudo apt install lcov
- mkdir build
- cd build
- CC=gcc CXX=g++ cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS_DEBUG=" --coverage " -DPARLAY_TEST=On ..
- make
- make check
- lcov --directory . --capture --output-file coverage.info
- lcov --remove coverage.info '/usr/*' '*/googletest/*' '*/test/*' --output-file coverage.info
- lcov --list coverage.info
- bash <(curl -s https://codecov.io/bash) -f coverage.info