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

Commit

Permalink
Add more compilers to Travis (#96)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
isaachier authored May 6, 2018
1 parent 2d556ab commit bf18cce
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 41 deletions.
1 change: 0 additions & 1 deletion .dockerignore

This file was deleted.

75 changes: 59 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
language: cpp
sudo: true
dist: trusty
addons:
apt:
packages: &1
- lcov
matrix:
include:
- os: linux
Expand All @@ -9,40 +13,79 @@ matrix:
sources:
- ubuntu-toolchain-r-test
packages:
- *1
- g++-4.9
env:
- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9 && CMAKE_OPTIONS='-DCMAKE_BUILD_TYPE=Debug
-DBUILD_SHARED_LIBS=ON -DJAEGERTRACING_COVERAGE=ON'"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- *1
- g++-5
env:
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5 && CMAKE_OPTIONS='-DCMAKE_BUILD_TYPE=Debug
-DBUILD_SHARED_LIBS=ON -DJAEGERTRACING_COVERAGE=ON'"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- *1
- g++-6
- lcov
env:
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
- COVERAGE=ON
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6 && CMAKE_OPTIONS='-DCMAKE_BUILD_TYPE=Debug
-DBUILD_SHARED_LIBS=ON -DJAEGERTRACING_COVERAGE=ON'"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.9
- *1
- g++-7
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && CMAKE_OPTIONS='-DCMAKE_BUILD_TYPE=Debug
-DBUILD_SHARED_LIBS=ON -DJAEGERTRACING_COVERAGE=ON'"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- *1
- g++-7
env:
- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && CMAKE_OPTIONS='-DCMAKE_BUILD_TYPE=Release
-DJAEGERTRACING_PLUGIN=ON -DBUILD_TESTING=ON -DHUNTER_CONFIGURATION_TYPES=Release'"
branches:
only:
- master
before_install:
- eval "${MATRIX_EVAL}"
- mkdir cmake-download &&
cd cmake-download &&
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 &&
cd ..
- eval "${MATRIX_EVAL}"
- mkdir cmake-download && cd cmake-download && 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 && cd ..
script:
- ./scripts/build.sh
- CMAKE_OPTIONS="${CMAKE_OPTIONS}" ./scripts/build.sh
after_success:
- for f in $(find build -name '*.gcno'); do gcov-6 $f; done
- bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage
reports"
- CMAKE_OPTIONS="${CMAKE_OPTIONS}" ./scripts/upload-coverage.sh
cache:
directories:
- "$HOME/.hunter/_Base/Cache"
- "$HOME/.hunter/_Base/Cache"
env:
global:
- LANG="en_US.UTF-8"
- PATH="$TRAVIS_BUILD_DIR/cmake-download/bin:$PATH"
deploy:
provider: releases
api_key:
secure: Q2ZlNb0QHRfS+uZ4q9EEsWjv7s1EFqahF8aDLpoO8brSaLtImcMM5G9MHukxjh57NJnM0S9FOU6hJyAnSt8hOjmQH+7oXwvt1Uoqh5gmPXpxhmIcK753JxXeeKID6nxBImTk8JjBRV164k7Oyj401t8WqKYZB+s5PuZq4ND854Ak/kFFsZbMunsy0RX8LxrYTuxc3YBwWfa1oFXJIqxWN/J1YV6hSdCNtWuk2re796leql3vkNEogHUCHvTB/lmM4egcsF21TkpOuRrCww/DYTx4eLCjvwJKtGuLq8FKC8uMLMG5b2JgllpfFbEq5o6imqioKUjTuoS0TE0KzM4WQFgYo7itykgZRD3pvivSK8mJePjTjuDQukQ6i1PkT9wgxdkagPH/mD+JBzx+cAzy3jPgfxWFl29Yj1xsKpbUmeSjxWac87b8d3lEBfBNJ83QkfkC80ZrJufhy30RP47PTHLUNf/udiO722T6w6Zu6wEKFSjfoRqPa0Uj2Src8tonKt7Me9UDoHAJ+go0nIz27xc4haPFgg5NgxSSXDn9fAEiLlj48tQkI6bUl1U+HH1baWHoTrckUi7OpJZYU9zB4QLwhia7OhrVvNWtTIbyVF4+8OIw4uaMsEV3jsR0okREUKSH/yPGiouFvoiggVa3OIGDN+CLQ/7Pocw8msBSQ0U=
file: build/libjaegertracing_plugin.so
on:
repo: jaegertracing/jaeger-client-cpp
tags: true
skip_cleanup: true
23 changes: 12 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ if(BUILD_TESTING)

add_executable(UnitTest
src/jaegertracing/ConfigTest.cpp
src/jaegertracing/DynamicLoadTest.cpp
src/jaegertracing/ReferenceTest.cpp
src/jaegertracing/SpanContextTest.cpp
src/jaegertracing/SpanTest.cpp
Expand Down Expand Up @@ -284,7 +283,9 @@ if(BUILD_TESTING)
add_test(NAME UnitTest COMMAND UnitTest)

if(TARGET jaegertracing)
add_executable(DynamicallyLoadTracerTest src/jaegertracing/DynamicallyLoadTracerTest.cpp)
add_executable(DynamicallyLoadTracerTest
src/jaegertracing/DynamicLoadTest.cpp
src/jaegertracing/DynamicallyLoadTracerTest.cpp)
target_include_directories(DynamicallyLoadTracerTest PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/src>)
target_link_libraries(
Expand All @@ -306,27 +307,27 @@ if(JAEGERTRACING_BUILD_CROSSDOCK)
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/crossdock>)
target_link_libraries(crossdock PUBLIC ${JAEGERTRACING_LIB})

set(JAEGER_CROSSDOCK_URL
"https://raw.githubusercontent.com/jaegertracing/jaeger/master/docker-compose/\
jaeger-docker-compose.yml")
string(CONCAT JAEGER_CROSSDOCK_URL
"https://raw.githubusercontent.com/"
"jaegertracing/jaeger/master/docker-compose/jaeger-docker-compose.yml")
file(DOWNLOAD ${JAEGER_CROSSDOCK_URL}
"${CMAKE_CURRENT_SOURCE_DIR}/crossdock/jaeger-docker-compose.yml")
find_program(DOCKER_COMPOSE_EXE docker-compose REQUIRED)
set(DOCKER_COMPOSE_CMD ${DOCKER_COMPOSE_EXE}
-f ${CMAKE_CURRENT_SOURCE_DIR}/crossdock/docker-compose.yml
-f ${CMAKE_CURRENT_SOURCE_DIR}/crossdock/jaeger-docker-compose.yml)
add_custom_target(crossdock-kill
COMMAND ${DOCKER_COMPOSE_CMD} kill
COMMAND ${DOCKER_COMPOSE_CMD} rm --force)
COMMAND ${DOCKER_COMPOSE_CMD} down)
add_custom_target(crossdock-run
COMMAND ${DOCKER_COMPOSE_CMD} build
COMMAND ${DOCKER_COMPOSE_CMD} run crossdock
DEPENDS crossdock-kill)
DEPENDS crossdock-kill
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_custom_target(crossdock-fresh
COMMAND ${DOCKER_COMPOSE_CMD} pull
COMMAND ${DOCKER_COMPOSE_CMD} build
COMMAND ${DOCKER_COMPOSE_CMD} build --pull --no-cache
COMMAND ${DOCKER_COMPOSE_CMD} run crossdock
DEPENDS crossdock-kill)
DEPENDS crossdock-kill
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_custom_target(crossdock-logs
COMMAND ${DOCKER_COMPOSE_CMD} logs)
endif()
Expand Down
12 changes: 2 additions & 10 deletions crossdock/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
FROM gcc:7.2

WORKDIR /
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

COPY . /app/jaegertracing
RUN rm -rf /app/jaegertracing/build && \
mkdir /app/jaegertracing/build && \
cd /app/jaegertracing/build && \
cmake -DCMAKE_BUILD_TYPE=Debug -DJAEGERTRACING_BUILD_CROSSDOCK=ON .. && \
make crossdock -j3
ADD ./build/crossdock /

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

EXPOSE 8080-8082

CMD ["/app/jaegertracing/build/crossdock"]
CMD ["/crossdock"]
2 changes: 1 addition & 1 deletion crossdock/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ services:
depends_on:
- test_driver
build:
context: ..
context: $PWD
dockerfile: crossdock/Dockerfile
ports:
- "8080-8082"
Expand Down
9 changes: 7 additions & 2 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@ function main() {

mkdir -p build
cd build
coverage_option=${COVERAGE:+"-DJAEGERTRACING_COVERAGE=ON"}
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON "${coverage_option}" ..
cmake ${CMAKE_OPTIONS} ..
make -j3 UnitTest
info "Running tests..."
./UnitTest
working "All tests compiled and passed"

set -x
if ! [[ "${CMAKE_OPTIONS}" =~ "-DJAEGERTRACING_BUILD_CROSSDOCK=ON" ]]; then
exit 0
fi
make crossdock-fresh
}

main
42 changes: 42 additions & 0 deletions scripts/upload-coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash

# Copyright (c) 2018 Uber Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -e

function main() {
set -x
if ! [[ "${CMAKE_OPTIONS}" =~ "-DJAEGERTRACING_COVERAGE=ON" ]]; then
exit 0
fi
unset -x

local project_dir
project_dir=$(git rev-parse --show-toplevel)
cd "$project_dir" || exit 1

local gcov_tool
case "$CC" in
gcc*) gcov_tool=${CC/gcc/gcov}
;;
*) gcov_tool="$project_dir/scripts/llvm-gcov.sh"
;;
esac
find build -name '*.gcno' -exec "$gcov_tool" {} \;
bash <(curl -s https://codecov.io/bash) || \
echo "Codecov did not collect coverage reports"
}

main

0 comments on commit bf18cce

Please sign in to comment.