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

Commit 6f2fc50

Browse files
committed
Travis Tests: Avoid code duplication
We currently have run scripts for each supported debian version. These run scripts are mostly very similiar. So it makes sense to use a common script. The differences are if we use COVERALLS support which we can support via environment variables. We also reduce the number of jobs in preparation for adding debian 10 (buster) support. We only keep the debug jobs of debian 9 and lower.
1 parent 8b7fc1a commit 6f2fc50

File tree

5 files changed

+42
-46
lines changed

5 files changed

+42
-46
lines changed

.travis.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ language: cpp
44

55
env:
66
matrix:
7-
- OS_TYPE=debian9 CMAKE_BUILD_TYPE=DEBUG SONAR_SCANNER=OFF COVERALLS=OFF
8-
- OS_TYPE=debian9 CMAKE_BUILD_TYPE=RELEASE SONAR_SCANNER=OFF COVERALLS=OFF
9-
- OS_TYPE=debian8 CMAKE_BUILD_TYPE=Debug SONAR_SCANNER=ON COVERALLS=ON
10-
- OS_TYPE=debian8 CMAKE_BUILD_TYPE=RELEASE SONAR_SCANNER=OFF COVERALLS=OFF
11-
- OS_TYPE=debian7 CMAKE_BUILD_TYPE=RELEASE SONAR_SCANNER=OFF COVERALLS=OFF
7+
- OS_TYPE=debian9 CMAKE_BUILD_TYPE=Debug SONAR_SCANNER=OFF COVERALLS=OFF NON_STOCK_CPPZMQ=ON
8+
- OS_TYPE=debian8 CMAKE_BUILD_TYPE=Debug SONAR_SCANNER=ON COVERALLS=ON NON_STOCK_CPPZMQ=OFF
9+
- OS_TYPE=debian7 CMAKE_BUILD_TYPE=Debug SONAR_SCANNER=OFF COVERALLS=OFF NON_STOCK_CPPZMQ=ON
1210

1311
notifications:
1412
email: false
@@ -44,12 +42,12 @@ before_script:
4442
- docker build --build-arg APP_UID=$(id -u) --build-arg APP_GID=$(id -g) -t cpp_tango .travis/${OS_TYPE}
4543
- docker run --name cpp_tango -e TANGO_HOST=${TANGO_HOST} -e BINTRAY_USER_NAME=tango-ci -e BINTRAY_API_KEY=${CI_BINTRAY_API_KEY} -e COVERALLS_REPO_TOKEN=${COVERALLS_REPO_TOKEN} --link tango_cs:tango_cs -v `pwd`:/home/tango/src -v `pwd`/idl:/home/tango/idl -v `pwd`/cppzmq:/home/tango/cppzmq -v `pwd`/coveralls-cmake:/home/tango/coveralls-cmake -v `pwd`/build-wrapper-linux-x86:/home/tango/build-wrapper-linux-x86 -dit cpp_tango
4644
- .travis/install_tango_idl.sh
47-
- .travis/install_cppzmq.sh
45+
- (test ${NON_STOCK_CPPZMQ} = "ON" && .travis/install_cppzmq.sh) || true
4846
#work around gcov ignored by sonar
4947
- sudo mkdir /home/tango && sudo mkdir /home/tango/src && sudo mount --bind `pwd` /home/tango/src
5048

5149
script:
52-
- .travis/${OS_TYPE}/run.sh
50+
- .travis/run.sh
5351
- .travis/test.sh COVERALLS=OFF
5452

5553
after_success:

.travis/debian7/run.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

.travis/debian8/run.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

.travis/debian9/run.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

.travis/run.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
echo "############################"
6+
echo "CMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE"
7+
echo "OS_TYPE=$OS_TYPE"
8+
echo "TANGO_HOST=$TANGO_HOST"
9+
echo "COVERALLS=$COVERALLS"
10+
echo "############################"
11+
12+
docker exec cpp_tango mkdir -p /home/tango/src/build
13+
14+
# set defaults
15+
MAKEFLAGS=${MAKEFLAGS:- -j 2}
16+
COVERALLS=${COVERALLS:-OFF}
17+
USE_PCH=${USE_PCH:-OFF}
18+
COVERALLS_MODULE_PATH=/home/tango/coveralls-cmake/cmake
19+
20+
docker exec cpp_tango cmake \
21+
-H/home/tango/src \
22+
-B/home/tango/src/build \
23+
-DCMAKE_VERBOSE_MAKEFILE=ON \
24+
-DCPPZMQ_BASE=/home/tango \
25+
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
26+
-DCOVERALLS=${COVERALLS} \
27+
-DCOVERALLS_MODULE_PATH=${COVERALLS_MODULE_PATH}
28+
29+
if [[ "$COVERALLS" == "ON" ]]
30+
then
31+
docker exec cpp_tango \
32+
/home/tango/build-wrapper-linux-x86/build-wrapper-linux-x86-64 \
33+
--out-dir /home/tango/src/bw-output \
34+
make -C /home/tango/src/build
35+
else
36+
docker exec cpp_tango make -C /home/tango/src/build
37+
fi

0 commit comments

Comments
 (0)