forked from tango-controls/cppTango
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
102 lines (91 loc) · 2.96 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
dist: xenial
language: cpp
env:
global:
- SONAR_SCANNER=OFF
- COVERALLS=OFF
- RUN_TESTS=ON
- STOCK_CPPZMQ=ON
- USE_PCH=ON
- CMAKE_BUILD_TYPE=Debug
- TANGO_USE_USING_NAMESPACE=ON
matrix:
- OS_TYPE=llvm-latest RUN_TESTS=OFF WARNINGS_AS_ERRORS=ON TANGO_USE_USING_NAMESPACE=OFF USE_PCH=OFF
- OS_TYPE=gcc-latest RUN_TESTS=OFF WARNINGS_AS_ERRORS=ON TANGO_USE_USING_NAMESPACE=OFF USE_PCH=OFF
- OS_TYPE=ubuntu-20.04
- OS_TYPE=debian10
- OS_TYPE=debian10 USE_PCH=OFF RUN_TESTS=OFF
- OS_TYPE=debian10 CMAKE_BUILD_TYPE=Release
- OS_TYPE=debian9
- OS_TYPE=debian8 SONAR_SCANNER=ON COVERALLS=ON STOCK_CPPZMQ=OFF
notifications:
email: false
services:
- docker
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.9
update: true
sonarcloud:
organization: "tango-controls"
token:
secure: ${SONAR_TOKEN}
before_install:
- docker pull tangocs/mysql:9.2.2
- docker pull tangocs/tango-cs:latest
- git clone https://github.com/JoakimSoderberg/coveralls-cmake.git
- (test ${STOCK_CPPZMQ} = "OFF" && git clone -b v4.2.2 https://${CI_USER_TOKEN}@github.com/zeromq/cppzmq.git cppzmq) || mkdir cppzmq
- git clone -b tango-9-lts https://${CI_USER_TOKEN}@github.com/tango-controls/tango-idl.git idl
- git clone -b Release_1.15 https://github.com/tango-controls/tango_admin.git
- wget https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip && unzip build-wrapper-linux-x86.zip
before_script:
- >
docker build
--build-arg APP_UID=$(id -u)
--build-arg APP_GID=$(id -g)
-t cpp_tango
.travis/${OS_TYPE}
- >
docker run
--rm
--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}
-v `pwd`:/home/tango/src
-v `pwd`/idl:/home/tango/idl
-v `pwd`/cppzmq:/home/tango/cppzmq
-v `pwd`/tango_admin:/home/tango/tango_admin
-v `pwd`/coveralls-cmake:/home/tango/coveralls-cmake
-v `pwd`/build-wrapper-linux-x86:/home/tango/build-wrapper-linux-x86
-v /var/run/docker.sock:/var/run/docker.sock
-dit
cpp_tango
- >
docker exec -u root cpp_tango
groupadd -g $(grep docker /etc/group | awk -F ':' '{print $3}') dockerhost || true
- docker exec -u root cpp_tango usermod -a -G dockerhost tango || true
- .travis/install_tango_idl.sh
- (test ${STOCK_CPPZMQ} = "OFF" && .travis/install_cppzmq.sh) || true
#work around gcov ignored by sonar
- sudo mkdir /home/tango && sudo mkdir /home/tango/src && sudo mount --bind `pwd` /home/tango/src
script:
- set -e
- .travis/run.sh
- .travis/install_tango.sh
- .travis/install_tango_admin.sh
- .travis/test.sh
- set +e
after_success:
- test ${SONAR_SCANNER} = "ON" && .travis/sonar.sh
deploy:
- provider: script
script: bash .travis/deploy.sh
on:
tags: true
after-script:
- docker stop cpp_tango