-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
99 lines (95 loc) · 2.54 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
language: cpp
jobs:
include:
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
- libfftw3-dev
- libgsl0-dev
- libncurses-dev
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- clang-5.0
- libfftw3-dev
- libgsl0-dev
- libncurses-dev
env:
- MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0"
- os: osx
osx_image: xcode10
compiler: clang
- stage: coverage
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
- libfftw3-dev
- libgsl0-dev
- libncurses-dev
- lcov
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && COVERAGE=ON"
before_install:
- eval "${MATRIX_EVAL}"
#- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install gsl; fi
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
wget "http://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh" -O miniconda.sh;
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
hash -r
conda update -yq conda
conda install -y cmake gsl fftw -c conda-forge
fi
script:
# Build
- mkdir $TRAVIS_BUILD_DIR/build
- cd $TRAVIS_BUILD_DIR/build
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
export INSTALL_PREFIX=$HOME/miniconda
else
export INSTALL_PREFIX=$HOME/.local
fi
- cmake -DCOVERAGE=$COVERAGE -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX ..
- make -j2
- make install
- export PATH="$INSTALL_PREFIX/bin:$PATH"
- hash -r
- if [[ "$COVERAGE" == "ON" ]]; then gem install coveralls-lcov; fi
# base line coverage
- if [[ "$COVERAGE" == "ON" ]]; then lcov -c -i -d $TRAVIS_BUILD_DIR -o baseline.info; fi
# Run test
- |
cd $TRAVIS_BUILD_DIR/test/run
mkdir tmp_data
barcode
cd -
# Unit tests
- |
cd $TRAVIS_BUILD_DIR/test
$TRAVIS_BUILD_DIR/build/test/io_array
$TRAVIS_BUILD_DIR/build/test/parameter_input_file
cd -
after_success:
- |
if [[ "${COVERAGE}" == "ON" ]]; then
cd ${TRAVIS_BUILD_DIR}
lcov --directory . --capture --output-file coverage.info # capture coverage info
lcov -a $TRAVIS_BUILD_DIR/build/baseline.info -a coverage.info -o coverage.info
lcov --remove coverage.info 'test/*' '/usr/*' 'miniconda/*' 'ext/*' --output-file coverage.info # filter out system and test code and external includes
lcov --list coverage.info # debug before upload
coveralls-lcov coverage.info # uploads to coveralls
fi