forked from tatsy/lime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
96 lines (81 loc) · 3.24 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
language: cpp
sudo: required
compiler:
- gcc
- clang
services:
- docker
before_install:
- sudo apt-get -qq update
- sudo apt-get -qq install llvm
install:
# Pull Docker image
- docker pull tatsy/ubuntu-cxx:opencv
# Dynamically generate Dockerfile
- sed -i -e "s/@C_COMPILER@/$CC/" Dockerfile
- sed -i -e "s/@CXX_COMPILER@/$CXX/" Dockerfile
- sed -i -e "s/@BRANCH_NAME@/$TRAVIS_BRANCH/" Dockerfile
- sed -i -e "s/@PULL_REQUEST@/$TRAVIS_PULL_REQUEST/" Dockerfile
- sed -i -e "s/@PYTHON_VERSION@/$PYTHON_VERSION/" Dockerfile
# Build Dockerfile
- docker build --tag=lime-env .
# Run container
- docker run --name lime-env --env="CI=true" --env="TRAVIS_JOB_ID=$TRAVIS_JOB_ID" --env="CTEST_OUTPUT_ON_FAILURE=TRUE" -itd lime-env
# Check Python module installation
- docker exec lime-env python -c "import lime; lime.print_version()"
script:
# Clear coverage infomation
- docker exec lime-env lcov --directory . --zerocounters
# Run test on Docker container
- docker exec lime-env make check
after_success:
# Collect coverage
- if [ $CXX = "g++" ]; then docker exec lime-env lcov --directory . --capture --output-file coverage.info; fi
- if [ $CXX = "clang++" ]; then docker exec lime-env lcov --directory . --capture --output-file coverage.info --gcov-tool llvm-cov; fi
- docker exec lime-env lcov --remove coverage.info 'tests/*' 'examples/*' '/usr/*' 'CMakeFiles/*' --output-file coverage.info
- docker exec lime-env lcov --list coverage.info
- docker exec lime-env coveralls-lcov --repo-token c6Fd5h2Ovd2c5PV7agagA89sUhsZCwIPR coverage.info
before_deploy:
- docker cp lime-env:/root/lime/VERSION .
- export LIME_VERSION=`cat VERSION`
- git config --global user.name "Travis CI"
- git config --global user.email "[email protected]"
- sudo apt-get -qq install doxygen
- wget -q https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/anaconda
- export PATH="$HOME/anaconda/bin:$PATH"
- conda update --yes conda
- conda install --yes sphinx
- pip install breathe sphinx_rtd_theme
- patch -u $HOME/anaconda/lib/python3.6/site-packages/breathe/renderer/sphinxrenderer.py < docs/sphinxrenderer.py.patch
- cd docs && sh ./deploy_docs.sh && cd -
- mkdir packages
- tar czvf packages/releases-v${LIME_VERSION}.tar.gz $(ls -I packages)
- zip -q packages/releases-v${LIME_VERSION}.zip -r $(ls -I packages)
- git tag v${LIME_VERSION} -a -m "Commit from Travis CI for build $TRAVIS_BUILD_NUMBER"
- git push --tags --quiet https://[email protected]/tatsy/lime.git 2> /dev/null
deploy:
skip_cleanup: true
provider: releases
api-key:
secure: "PDNTAv4hlKC9ABcjsUj3HdYb3GvBRqENug1WcYuPwQNYlU4jhjHwmgvaVDEaelwDok/BGIfHP0RSEufg5NGDiFtDZGcO82uu5827Sf4E8Iajki34Mv+RgxH+9vPaf1UzY1+j98RxtVIPsrQcv9wQtBvw/9Jpn0t/XX1AvBmGe4Y="
file:
- packages/releases-v${LIME_VERSION}.tar.gz
- packages/releases-v${LIME_VERSION}.zip
on:
tags: false
branch: master
condition: "$CXX = clang++ && $PYTHON_VERSION = 3.5"
branches:
only:
- master
- development
env:
matrix:
- PYTHON_VERSION=2.7
- PYTHON_VERSION=3.5
notifications:
email:
recipients: [email protected]
on_success: change
on_failure: always