forked from PandoraPFA/LArContent
-
Notifications
You must be signed in to change notification settings - Fork 10
/
.travis.yml
56 lines (48 loc) · 2.35 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
language: cpp
sudo: required
dist: eoan
services:
- docker
matrix:
include:
- os: linux
env: MATRIX_EVAL="COMPILER=g++-7"
- os: linux
env: MATRIX_EVAL="COMPILER=clang-8"
before_install:
- eval "${MATRIX_EVAL}"
- if [[ ${TRAVIS_EVENT_TYPE} == cron && ${COMPILER} == g++* ]]; then
export CRON_GCC_BUILD=true;
export COVERITY_DESC=`date`;
export COVERITY_REPO=`echo ${TRAVIS_REPO_SLUG} | sed 's/\//\%2F/g'`;
else
export CRON_GCC_BUILD=false;
fi
- if [[ "${CRON_GCC_BUILD}" == true ]]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
docker run -itd --name pandora -v `pwd`:/pandora/package -e "COMPILER=$COMPILER" -e "CODECOV_TOKEN=$CODECOV_TOKEN" pandorapfa/pandorapfa_c17:latest /bin/bash;
else
docker run -itd --name pandora -v `pwd`:/pandora/package -e "COMPILER=$COMPILER" pandorapfa/pandorapfa_c17:latest /bin/bash;
fi
install:
- if [[ "${CRON_GCC_BUILD}" == true ]]; then
echo "Downloading Coverity Scan tool...";
wget https://scan.coverity.com/download/linux64 --post-data "token=${COVERITY_SCAN_TOKEN}&project=${COVERITY_REPO}" --no-check-certificate -O ./coverity_tool.tgz; mkdir cov-analysis-linux64; tar -xf coverity_tool.tgz -C cov-analysis-linux64 --strip-components=1 > /dev/null 2>&1;
fi
- docker exec -it pandora /bin/bash -c "source pull_pandora_pfa.sh"
- docker exec -it pandora /bin/bash -c "source install_pandora_sdk.sh"
- docker exec -it pandora /bin/bash -c "source install_pandora_monitoring.sh"
script:
- if [[ "${CRON_GCC_BUILD}" == true ]]; then
docker exec -it pandora /bin/bash -c "cd /pandora/package && source /pandora/build_larcontent.sh coverity";
curl --form token=${COVERITY_SCAN_TOKEN} --form email=${COVERITY_TARGET_EMAIL} --form file=@build/coverity_build.tgz --form version="master" --form description="${COVERITY_DESC}" https://scan.coverity.com/builds?project=${COVERITY_REPO};
docker exec -it pandora /bin/bash -c "cd /pandora/package && rm -rf build && source /pandora/build_larcontent.sh";
elif [[ "${TRAVIS_EVENT_TYPE}" == "cron" ]]; then
echo "Coverity does not use this build";
else
docker exec -it pandora /bin/bash -c "cd /pandora/package && source /pandora/build_larcontent.sh";
fi
notifications:
email:
on_success: never
on_failure: always