Skip to content
This repository was archived by the owner on Oct 28, 2021. It is now read-only.

Commit 032b031

Browse files
committed
CI: Use Python script CodeCov upload
1 parent 47427b9 commit 032b031

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

.travis.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,8 @@ before_script:
7575
script:
7676
- cd $TRAVIS_BUILD_DIR/build && ../scripts/tests.sh $TRAVIS_TESTS
7777
after_success:
78-
- cd $TRAVIS_BUILD_DIR/build
79-
- make coverage.data
80-
# Get CodeCov script (fixed commit) and upload coverage report.
81-
- bash <(curl -s https://raw.githubusercontent.com/codecov/codecov-bash/d8016a07d67d813f98afdbaf98dc4f46d9806118/codecov) -X fix -f coverage.data
78+
- pip install --user codecov
79+
- codecov
8280
after_script: |
8381
# Hunter: upload cache to the cache server.
8482
if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" ]]; then

circle.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ defaults:
99
upload-hunter-cache: &upload-hunter-cache
1010
run:
1111
name: "Upload Hunter cache"
12+
working_directory: ~/build
1213
command: | # Upload Hunter cache if not PR build.
1314
if [ ! "$CIRCLE_PR_NUMBER" ]; then
14-
cmake --build build --target hunter_upload_cache
15+
cmake --build . --target hunter_upload_cache
1516
fi
1617
1718
environment-info: &environment-info
@@ -25,19 +26,22 @@ defaults:
2526
configure: &configure
2627
run:
2728
name: "Configure"
29+
# Build "out-of-source" to have better coverage report
30+
# (ninja is using relative paths otherwise).
31+
working_directory: ~/build
2832
command: |
29-
mkdir -p build && cd build
30-
cmake .. -G "$GENERATOR" -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCOVERAGE=ON $CMAKE_OPTIONS
33+
cmake ../project -G "$GENERATOR" -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCOVERAGE=ON $CMAKE_OPTIONS
3134
3235
build: &build
3336
run:
3437
name: "Build"
35-
command: cmake --build build -- -j $BUILD_PARALLEL_JOBS
38+
working_directory: ~/build
39+
command: cmake --build . -- -j $BUILD_PARALLEL_JOBS
3640

3741
test: &test
3842
run:
3943
name: "Test"
40-
pwd: build
44+
working_directory: ~/build
4145
command: |
4246
if [ $(uname) = Linux ]; then
4347
export TMPDIR=/dev/shm
@@ -84,8 +88,10 @@ defaults:
8488
upload-coverage-data: &upload-coverage-data
8589
run:
8690
name: "Upload coverage data"
87-
pwd: build
88-
command: codecov
91+
command: |
92+
pwd
93+
$GCOV --version
94+
codecov --required --gcov-exec "$GCOV" --gcov-root ~/build
8995
9096
linux-steps: &linux-steps
9197
- checkout
@@ -110,6 +116,7 @@ jobs:
110116
environment:
111117
- CXX: clang++-5.0
112118
- CC: clang-5.0
119+
- GCOV: llvm-cov-5.0 gcov
113120
- GENERATOR: Ninja
114121
- BUILD_PARALLEL_JOBS: 8
115122
- TEST_PARALLEL_JOBS: 8
@@ -122,6 +129,7 @@ jobs:
122129
- BUILD_TYPE: Debug
123130
- CXX: g++-6
124131
- CC: gcc-6
132+
- GCOV: gcov-6
125133
- GENERATOR: Ninja
126134
- BUILD_PARALLEL_JOBS: 4
127135
- TEST_PARALLEL_JOBS: 4
@@ -135,6 +143,7 @@ jobs:
135143
macOS-XCode9:
136144
environment:
137145
- CXX: clang++
146+
- GCOV: gcov
138147
- GENERATOR: Ninja
139148
- BUILD_PARALLEL_JOBS: 8
140149
- TEST_PARALLEL_JOBS: 8

0 commit comments

Comments
 (0)