forked from geneo4PETSc/geneo4PETSc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
155 lines (124 loc) · 6.57 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
language: cpp
notifications:
email:
on_success: always
on_failure: never
matrix:
include:
# Ubuntu + python-2.
- os: linux
dist: trusty
sudo: required
addons:
apt:
sources:
# update trusty with unsupported packages from this untrusted PPA.
- ubuntu-toolchain-r-test
packages:
- gfortran-7
- gcc-7
- g++-7
- libstdc++-7-dev
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && FC=gfortran-7"
python: 2.7
# Ubuntu + python-3.
- os: linux
dist: trusty
sudo: required
addons:
apt:
sources:
# update trusty with unsupported packages from this untrusted PPA.
- ubuntu-toolchain-r-test
packages:
- gfortran-7
- gcc-7
- g++-7
- libstdc++-7-dev
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && FC=gfortran-7"
python: 3.3
virtualenv:
# system_site_packages is needed for pip to be allowed to install packages in the system
system_site_packages: true
before_install:
- eval "${MATRIX_EVAL}"
install:
# OS: update, upgrade.
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get remove postgresql-client*; fi # Remove: it breaks the ubuntu14-LTS upgrade...
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get -y --allow-unauthenticated -o Dpkg::Options::="--force-confdef" upgrade; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get -y --allow-unauthenticated -o Dpkg::Options::="--force-confdef" dist-upgrade; fi
# packages: install from repositories.
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libc-dev; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install wget gzip tar; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install git; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install gfortran gcc g++ libc++-dev; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install openmpi-bin openmpi-common libopenmpi-dev; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libboost-mpi-dev; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install liblapack-dev; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install cmake; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install autoconf automake; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install diffutils findutils; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libbz2-dev; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install python-minimal python-tk python-pip; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install python3-minimal python3-tk python3-pip; fi
# python: install from pip.
- sudo pip install --ignore-installed --upgrade pip
- sudo pip install --ignore-installed --upgrade --upgrade-strategy only-if-needed argparse numpy matplotlib
- sudo pip3 install --ignore-installed --upgrade pip
- sudo pip3 install --ignore-installed --upgrade --upgrade-strategy only-if-needed argparse numpy matplotlib
# code quality: install checkers.
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install cppcheck shellcheck; sudo pip install pylint; fi
before_script:
# start X server to enable matplotlib to create images.
- export DISPLAY=":99.0"
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sh -e /etc/init.d/xvfb start; fi
script:
# code quality.
- pushd $TRAVIS_BUILD_DIR
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./dev.sh; fi
# remove old logs (avoid pollution in case of failure).
- rm -f $TRAVIS_BUILD_DIR/prq/*/prq.*.log
- rm -f $TRAVIS_BUILD_DIR/prq/*petsc*/*arch*/externalpackages/*/*.log
- rm -f $TRAVIS_BUILD_DIR/prq/*slepc*/*arch*/externalpackages/*/*.log
# compile openmpi and boost (travis ones may be outdated even after upgrade).
- pushd $TRAVIS_BUILD_DIR
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then travis_wait 25 ./prq.sh openmpi; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then travis_wait 25 ./prq.sh boost; fi
# build and install petsc and slepc.
- pushd $TRAVIS_BUILD_DIR
- travis_wait 25 ./prq.sh petsc
- travis_wait 25 ./prq.sh slepc
- export PATH="$TRAVIS_BUILD_DIR/prq/local/bin:${PATH}"
- export LD_LIBRARY_PATH="$TRAVIS_BUILD_DIR/prq/local/lib:${LD_LIBRARY_PATH}"
- export PKG_CONFIG_PATH="$TRAVIS_BUILD_DIR/prq/local/lib/pkgconfig:${PKG_CONFIG_PATH}"
- export CMAKE_PREFIX_PATH="$TRAVIS_BUILD_DIR/prq/local:${CMAKE_PREFIX_PATH}"
# build and test.
- pushd $TRAVIS_BUILD_DIR
- mkdir BUILD; pushd BUILD
- cmake --version
- export BOOST_FLAGS="-Wno-expansion-to-defined" # Prevent boost errors.
- cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-Wall -Wextra -pedantic -pedantic-errors $BOOST_FLAGS --coverage" ..
- make VERBOSE=1
- travis_wait 25 make checkv
cache:
directories:
# cache build directories: speed-up build future validations.
- $TRAVIS_BUILD_DIR/prq
after_failure:
# show build error or test log to know what is wrong if errors occured.
- tail -n 75 $TRAVIS_BUILD_DIR/prq/*mpi*/prq.*.log
- tail -n 75 $TRAVIS_BUILD_DIR/prq/*boost*/prq.*.log
- tail -n 75 $TRAVIS_BUILD_DIR/prq/*petsc*/prq.*.log
- tail -n 75 $TRAVIS_BUILD_DIR/prq/*petsc*/*arch*/externalpackages/*/*.log
- tail -n 75 $TRAVIS_BUILD_DIR/prq/*slepc*/prq.*.log
- tail -n 75 $TRAVIS_BUILD_DIR/prq/*slepc*/*arch*/externalpackages/*/*.log
- if [[ -f $TRAVIS_BUILD_DIR/BUILD/Testing/Temporary/LastTest.log ]]; then cat $TRAVIS_BUILD_DIR/BUILD/Testing/Temporary/LastTest.log; fi
after_success:
# get coverage.
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pushd src && pushd CMakeFiles && pushd geneo4PETSc.dir; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then gcov -s ../../../../src geneo4PETSc.cpp; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then gcov -s ../../../../src geneo.cpp; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then bash <(curl -s https://codecov.io/bash); fi