Skip to content
This repository was archived by the owner on Aug 30, 2022. It is now read-only.

Commit bf18cce

Browse files
authored
Add more compilers to Travis (#96)
* Add more compilers to Travis Signed-off-by: Isaac Hier <[email protected]> * Override CMake options directly in Travis Signed-off-by: Isaac Hier <[email protected]> * Add script to upload coverage, build crossdock test Signed-off-by: Isaac Hier <[email protected]> * Fix Travis tokens Signed-off-by: Isaac Hier <[email protected]> * Add crossdock to build Signed-off-by: Isaac Hier <[email protected]> * Try reevaluating matrix env Signed-off-by: Isaac Hier <[email protected]> * Run bash with -x Signed-off-by: Isaac Hier <[email protected]> * Use -x in script Signed-off-by: Isaac Hier <[email protected]> * Try using env to pass variables Signed-off-by: Isaac Hier <[email protected]> * Fix command syntax Signed-off-by: Isaac Hier <[email protected]> * Correct build step Signed-off-by: Isaac Hier <[email protected]> * Fixes for static builds and crossdock Signed-off-by: Isaac Hier <[email protected]> * Fix crossdock build Signed-off-by: Isaac Hier <[email protected]> * Remove crossdock build from Travis matrix for now Signed-off-by: Isaac Hier <[email protected]> * Add Travis plugin deployment Signed-off-by: Isaac Hier <[email protected]>
1 parent 2d556ab commit bf18cce

File tree

7 files changed

+123
-41
lines changed

7 files changed

+123
-41
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.travis.yml

Lines changed: 59 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
language: cpp
22
sudo: true
33
dist: trusty
4+
addons:
5+
apt:
6+
packages: &1
7+
- lcov
48
matrix:
59
include:
610
- os: linux
@@ -9,40 +13,79 @@ matrix:
913
sources:
1014
- ubuntu-toolchain-r-test
1115
packages:
16+
- *1
17+
- g++-4.9
18+
env:
19+
- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9 && CMAKE_OPTIONS='-DCMAKE_BUILD_TYPE=Debug
20+
-DBUILD_SHARED_LIBS=ON -DJAEGERTRACING_COVERAGE=ON'"
21+
- os: linux
22+
addons:
23+
apt:
24+
sources:
25+
- ubuntu-toolchain-r-test
26+
packages:
27+
- *1
28+
- g++-5
29+
env:
30+
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5 && CMAKE_OPTIONS='-DCMAKE_BUILD_TYPE=Debug
31+
-DBUILD_SHARED_LIBS=ON -DJAEGERTRACING_COVERAGE=ON'"
32+
- os: linux
33+
addons:
34+
apt:
35+
sources:
36+
- ubuntu-toolchain-r-test
37+
packages:
38+
- *1
1239
- g++-6
13-
- lcov
1440
env:
15-
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
16-
- COVERAGE=ON
41+
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6 && CMAKE_OPTIONS='-DCMAKE_BUILD_TYPE=Debug
42+
-DBUILD_SHARED_LIBS=ON -DJAEGERTRACING_COVERAGE=ON'"
1743
- os: linux
1844
addons:
1945
apt:
2046
sources:
2147
- ubuntu-toolchain-r-test
2248
packages:
23-
- g++-4.9
49+
- *1
50+
- g++-7
51+
env:
52+
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && CMAKE_OPTIONS='-DCMAKE_BUILD_TYPE=Debug
53+
-DBUILD_SHARED_LIBS=ON -DJAEGERTRACING_COVERAGE=ON'"
54+
- os: linux
55+
addons:
56+
apt:
57+
sources:
58+
- ubuntu-toolchain-r-test
59+
packages:
60+
- *1
61+
- g++-7
2462
env:
25-
- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
63+
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && CMAKE_OPTIONS='-DCMAKE_BUILD_TYPE=Release
64+
-DJAEGERTRACING_PLUGIN=ON -DBUILD_TESTING=ON -DHUNTER_CONFIGURATION_TYPES=Release'"
2665
branches:
2766
only:
2867
- master
2968
before_install:
30-
- eval "${MATRIX_EVAL}"
31-
- mkdir cmake-download &&
32-
cd cmake-download &&
33-
curl -O https://cmake.org/files/v3.10/cmake-3.10.0-rc5-Linux-x86_64.sh &&
34-
bash cmake-3.10.0-rc5-Linux-x86_64.sh --skip-license &&
35-
cd ..
69+
- eval "${MATRIX_EVAL}"
70+
- mkdir cmake-download && cd cmake-download && curl -O https://cmake.org/files/v3.10/cmake-3.10.0-rc5-Linux-x86_64.sh
71+
&& bash cmake-3.10.0-rc5-Linux-x86_64.sh --skip-license && cd ..
3672
script:
37-
- ./scripts/build.sh
73+
- CMAKE_OPTIONS="${CMAKE_OPTIONS}" ./scripts/build.sh
3874
after_success:
39-
- for f in $(find build -name '*.gcno'); do gcov-6 $f; done
40-
- bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage
41-
reports"
75+
- CMAKE_OPTIONS="${CMAKE_OPTIONS}" ./scripts/upload-coverage.sh
4276
cache:
4377
directories:
44-
- "$HOME/.hunter/_Base/Cache"
78+
- "$HOME/.hunter/_Base/Cache"
4579
env:
4680
global:
4781
- LANG="en_US.UTF-8"
4882
- PATH="$TRAVIS_BUILD_DIR/cmake-download/bin:$PATH"
83+
deploy:
84+
provider: releases
85+
api_key:
86+
secure: Q2ZlNb0QHRfS+uZ4q9EEsWjv7s1EFqahF8aDLpoO8brSaLtImcMM5G9MHukxjh57NJnM0S9FOU6hJyAnSt8hOjmQH+7oXwvt1Uoqh5gmPXpxhmIcK753JxXeeKID6nxBImTk8JjBRV164k7Oyj401t8WqKYZB+s5PuZq4ND854Ak/kFFsZbMunsy0RX8LxrYTuxc3YBwWfa1oFXJIqxWN/J1YV6hSdCNtWuk2re796leql3vkNEogHUCHvTB/lmM4egcsF21TkpOuRrCww/DYTx4eLCjvwJKtGuLq8FKC8uMLMG5b2JgllpfFbEq5o6imqioKUjTuoS0TE0KzM4WQFgYo7itykgZRD3pvivSK8mJePjTjuDQukQ6i1PkT9wgxdkagPH/mD+JBzx+cAzy3jPgfxWFl29Yj1xsKpbUmeSjxWac87b8d3lEBfBNJ83QkfkC80ZrJufhy30RP47PTHLUNf/udiO722T6w6Zu6wEKFSjfoRqPa0Uj2Src8tonKt7Me9UDoHAJ+go0nIz27xc4haPFgg5NgxSSXDn9fAEiLlj48tQkI6bUl1U+HH1baWHoTrckUi7OpJZYU9zB4QLwhia7OhrVvNWtTIbyVF4+8OIw4uaMsEV3jsR0okREUKSH/yPGiouFvoiggVa3OIGDN+CLQ/7Pocw8msBSQ0U=
87+
file: build/libjaegertracing_plugin.so
88+
on:
89+
repo: jaegertracing/jaeger-client-cpp
90+
tags: true
91+
skip_cleanup: true

CMakeLists.txt

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ if(BUILD_TESTING)
250250

251251
add_executable(UnitTest
252252
src/jaegertracing/ConfigTest.cpp
253-
src/jaegertracing/DynamicLoadTest.cpp
254253
src/jaegertracing/ReferenceTest.cpp
255254
src/jaegertracing/SpanContextTest.cpp
256255
src/jaegertracing/SpanTest.cpp
@@ -284,7 +283,9 @@ if(BUILD_TESTING)
284283
add_test(NAME UnitTest COMMAND UnitTest)
285284

286285
if(TARGET jaegertracing)
287-
add_executable(DynamicallyLoadTracerTest src/jaegertracing/DynamicallyLoadTracerTest.cpp)
286+
add_executable(DynamicallyLoadTracerTest
287+
src/jaegertracing/DynamicLoadTest.cpp
288+
src/jaegertracing/DynamicallyLoadTracerTest.cpp)
288289
target_include_directories(DynamicallyLoadTracerTest PUBLIC
289290
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/src>)
290291
target_link_libraries(
@@ -306,27 +307,27 @@ if(JAEGERTRACING_BUILD_CROSSDOCK)
306307
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/crossdock>)
307308
target_link_libraries(crossdock PUBLIC ${JAEGERTRACING_LIB})
308309

309-
set(JAEGER_CROSSDOCK_URL
310-
"https://raw.githubusercontent.com/jaegertracing/jaeger/master/docker-compose/\
311-
jaeger-docker-compose.yml")
310+
string(CONCAT JAEGER_CROSSDOCK_URL
311+
"https://raw.githubusercontent.com/"
312+
"jaegertracing/jaeger/master/docker-compose/jaeger-docker-compose.yml")
312313
file(DOWNLOAD ${JAEGER_CROSSDOCK_URL}
313314
"${CMAKE_CURRENT_SOURCE_DIR}/crossdock/jaeger-docker-compose.yml")
314315
find_program(DOCKER_COMPOSE_EXE docker-compose REQUIRED)
315316
set(DOCKER_COMPOSE_CMD ${DOCKER_COMPOSE_EXE}
316317
-f ${CMAKE_CURRENT_SOURCE_DIR}/crossdock/docker-compose.yml
317318
-f ${CMAKE_CURRENT_SOURCE_DIR}/crossdock/jaeger-docker-compose.yml)
318319
add_custom_target(crossdock-kill
319-
COMMAND ${DOCKER_COMPOSE_CMD} kill
320-
COMMAND ${DOCKER_COMPOSE_CMD} rm --force)
320+
COMMAND ${DOCKER_COMPOSE_CMD} down)
321321
add_custom_target(crossdock-run
322322
COMMAND ${DOCKER_COMPOSE_CMD} build
323323
COMMAND ${DOCKER_COMPOSE_CMD} run crossdock
324-
DEPENDS crossdock-kill)
324+
DEPENDS crossdock-kill
325+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
325326
add_custom_target(crossdock-fresh
326-
COMMAND ${DOCKER_COMPOSE_CMD} pull
327-
COMMAND ${DOCKER_COMPOSE_CMD} build
327+
COMMAND ${DOCKER_COMPOSE_CMD} build --pull --no-cache
328328
COMMAND ${DOCKER_COMPOSE_CMD} run crossdock
329-
DEPENDS crossdock-kill)
329+
DEPENDS crossdock-kill
330+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
330331
add_custom_target(crossdock-logs
331332
COMMAND ${DOCKER_COMPOSE_CMD} logs)
332333
endif()

crossdock/Dockerfile

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
FROM gcc:7.2
22

3-
WORKDIR /
4-
RUN curl -O https://cmake.org/files/v3.10/cmake-3.10.0-rc5-Linux-x86_64.sh && bash cmake-3.10.0-rc5-Linux-x86_64.sh --skip-license
5-
6-
COPY . /app/jaegertracing
7-
RUN rm -rf /app/jaegertracing/build && \
8-
mkdir /app/jaegertracing/build && \
9-
cd /app/jaegertracing/build && \
10-
cmake -DCMAKE_BUILD_TYPE=Debug -DJAEGERTRACING_BUILD_CROSSDOCK=ON .. && \
11-
make crossdock -j3
3+
ADD ./build/crossdock /
124

135
ENV AGENT_HOST_PORT=jaeger-agent:5775
146
ENV SAMPLING_SERVER_URL=http://test_driver:5778/sampling
157

168
EXPOSE 8080-8082
179

18-
CMD ["/app/jaegertracing/build/crossdock"]
10+
CMD ["/crossdock"]

crossdock/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ services:
3939
depends_on:
4040
- test_driver
4141
build:
42-
context: ..
42+
context: $PWD
4343
dockerfile: crossdock/Dockerfile
4444
ports:
4545
- "8080-8082"

scripts/build.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,17 @@ function main() {
2424

2525
mkdir -p build
2626
cd build
27-
coverage_option=${COVERAGE:+"-DJAEGERTRACING_COVERAGE=ON"}
28-
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON "${coverage_option}" ..
27+
cmake ${CMAKE_OPTIONS} ..
2928
make -j3 UnitTest
3029
info "Running tests..."
3130
./UnitTest
3231
working "All tests compiled and passed"
32+
33+
set -x
34+
if ! [[ "${CMAKE_OPTIONS}" =~ "-DJAEGERTRACING_BUILD_CROSSDOCK=ON" ]]; then
35+
exit 0
36+
fi
37+
make crossdock-fresh
3338
}
3439

3540
main

scripts/upload-coverage.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
3+
# Copyright (c) 2018 Uber Technologies, Inc.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -e
18+
19+
function main() {
20+
set -x
21+
if ! [[ "${CMAKE_OPTIONS}" =~ "-DJAEGERTRACING_COVERAGE=ON" ]]; then
22+
exit 0
23+
fi
24+
unset -x
25+
26+
local project_dir
27+
project_dir=$(git rev-parse --show-toplevel)
28+
cd "$project_dir" || exit 1
29+
30+
local gcov_tool
31+
case "$CC" in
32+
gcc*) gcov_tool=${CC/gcc/gcov}
33+
;;
34+
*) gcov_tool="$project_dir/scripts/llvm-gcov.sh"
35+
;;
36+
esac
37+
find build -name '*.gcno' -exec "$gcov_tool" {} \;
38+
bash <(curl -s https://codecov.io/bash) || \
39+
echo "Codecov did not collect coverage reports"
40+
}
41+
42+
main

0 commit comments

Comments
 (0)