forked from equinor/segyio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
165 lines (153 loc) · 5.92 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
156
157
158
159
160
161
162
163
164
165
language: python
python:
- 2.7
- 3.4
- 3.5
- 3.6
env:
global:
- UNICODE_WIDTH=32
- PLAT=x86_64
- MB_PYTHON_VERSION=$TRAVIS_PYTHON_VERSION
- VERSION=$(echo $TRAVIS_TAG | sed s/v//)
os:
- linux
services: docker
sudo: required
matrix:
fast_finish: true
include:
- python: 3.7
dist: xenial
sudo: true
- compiler: clang
python: 3.7
dist: xenial
env:
- SCAN="scan-build --status-bugs"
- SOURCEDEPLOY=1
- MKDOC="-DBUILD_DOC=ON -DSPHINX_ARGS=-WT"
- os: osx
language: generic
env: MB_PYTHON_VERSION=2.7
python: 2.7
- os: osx
language: generic
env: MB_PYTHON_VERSION=3.4
python: 3.4
- os: osx
language: generic
env: MB_PYTHON_VERSION=3.5
python: 3.5
- os: osx
language: generic
env: MB_PYTHON_VERSION=3.6
python: 3.6
- os: osx
language: generic
env: MB_PYTHON_VERSION=3.7
python: 3.7
addons:
apt:
sources:
- sourceline: 'ppa:jokva/backports'
- george-edison55-precise-backports # cmake 3
packages:
- cppcheck
- cmake
- cmake-data
before_install:
- unset -f pushd
- unset -f popd
- source multibuild/common_utils.sh
- source multibuild/travis_steps.sh
- before_install
install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update && brew install cppcheck;
fi
- pip install -r requirements.txt
- pip install setuptools setuptools-scm scikit-build
- pip install bandit pytest pytest-runner sphinx sphinx-gallery
before_script:
- enabled="-DBUILD_PYTHON=OFF -DBUILD_MEX=OFF"
- if [[ -n "${MB_PYTHON_VERSION+1}" ]]; then
enabled="$enabled -DBUILD_PYTHON=ON -DREQUIRE_PYTHON=ON";
fi
- bandit -c bandit.yml -r python
- cmake --version
- mkdir build
- pushd build
- $SCAN cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
-DBUILD_SHARED_LIBS=ON
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_NAME_DIR=/usr/local/lib
$MKDOC
$enabled ..
- cppcheck --enable=style,portability,performance,warning
--library=posix
--library=$TRAVIS_BUILD_DIR/cppcheck/segyio.cfg
--suppressions-list=$TRAVIS_BUILD_DIR/cppcheck/suppressions.txt
--inline-suppr
--project=compile_commands.json
--error-exitcode=1
- popd
# distutils/setuptools on macos ignores the --rpath argument, so set
# DYLD_LIBRARY_PATH so that the freshly-built image is picked up on for the
# tests.
#
# segyio is configured with CMAKE_INSTALL_NAME_DIR so that the wheel build on
# OS X so the delocate tool can figure out what dylib to include.
script:
- pushd build
- export DYLD_LIBRARY_PATH=$PWD/lib
- $SCAN make && ctest --output-on-failure
- sudo make install
- popd
# install works, so remove the _skbuild because it having root permissions
# from make install breaks build_wheel
- sudo rm -rf python/_skbuild
- build_wheel python $PLAT
- install_run $PLAT
- mv wheelhouse python/dist
before_deploy:
# OS X ships with a tar that doesn't support --exclude-vcs, which is
# unproblematic as long as source code is uploaded from linux.
#
# when doing source deploy, remove the dist directory with pre-built wheels,
# otherwise they get picked up instead, which will surely fail because the
# wheel has already been uploaded to pypi.
- if [[ "$TRAVIS_OS_NAME" == "linux" && ! -d segyio-$VERSION ]]; then
git clone $TRAVIS_BUILD_DIR segyio-$VERSION;
echo "version = '$TRAVIS_TAG'" > segyio-$VERSION/python/segyio/version.py;
tar --exclude-vcs -C $TRAVIS_BUILD_DIR -czvf segyio-$VERSION.tar.gz segyio-$VERSION;
zip --exclude *.git -r segyio-$VERSION.zip $TRAVIS_BUILD_DIR/segyio-$VERSION/*;
fi
- pushd python
- if [[ $SOURCEDEPLOY ]]; then
rm -rf dist;
fi
after_deploy:
- popd
deploy:
- provider: pypi # upload built wheels and source tarball
skip_cleanup: true
skip_upload_docs: true
skip_existing: true
user: statoil-travis
distributions: --skip-cmake build sdist
password:
secure: BaPED+fUXxmk61N/RtrEWtlRKinc2d+VodwKxwlq/74n8Z6RfJKp/ZzlinbjtnpLB/1kPphxwCYLuG2N2nU2kttNJCQEw9AlPL1gnDxDVUz83KuxSsqLPj9VOdj9MI3xyUs+LC3PW2N4kw2dB+/n2pB7BIwvA+Ykx6+Z2eD2vyEV8WqndP6+vApracCbE8huNfsnbxMqr188qzXbTRnzR1pwVFYBTNJ5vfRf0z/NmHXFpRhKEUaaqazJaax1xp5FGVFg2Wy4GQVDvtn6bVpu/rV5wyWXXdXSqqAQmrwv10OZt5ROfb88yfx+ZilpYDeiHmH8YLj4BjcLpdNeNW0c/irgtejLpnd7+XTUKl2QJzDr2l2ShhuaT+ZN7W8iXXZ4xPPvgcudF9fELZXMy6sKXLPE9qhL1yo/1x2eQ662PgusyegoBcQxtJvc0I0ct7jpWUMU0YQhu6VQUDTaxluSw7kxmQ2WYIW0UJIMkn+AkPw8t/ZYa83RbteRM3I7bAthzNl0IF/t5rDUt8itb6f4eTxjP1+5QdlNkSTNG9KXIxP8wX843PtFKA1i8gcqCIppgoQAnEHHcTJ+nX/ilqXHBWIDiYX6k79B3Hflqj1IcBZjwbUdojLRsHuNb8JN0y8aNsrWyYKhV09+AmvFwo3pY543HOHq/Fuux9ZCUCTeLbo=
on:
tags: true
- provider: releases # upload tarball and zip with source code
skip_cleanup: true
overwrite: true
file:
- $TRAVIS_BUILD_DIR/segyio-$VERSION.tar.gz
- $TRAVIS_BUILD_DIR/segyio-$VERSION.zip
api_key:
secure: VdV/5kCCwUFwgU7wvKRrOy4u9nnvLsM3RoW1G2z8w8e838fcTeXLU3Zu8rLzLpcaXJKX07WNQmG85PZrgRjB9mzZAbXnPJeMk5MT3YVWaiyF6zNxK+mQQOvTCJ8P25nm5Iq1PLtIW/wM1RqNLgT8t3AsLiIva+6JK+2wGA2ilOl2YVgJqEiZV1f9DJutPewDf8pqYrnrHktMmkio/uubc12MLFOrNeQxK/EJahw7x56q8EcxrJXHnv6T2zEvUdcEYfRvIrT62jiVqiJP9wmUVdq2x8/RlgRzcCpGhy2o17iMUIH228so2hbu5/NcvtAh/LUDeqlhQ1YLRp1vO6H8Uh9B6aJgBNPwYmrKBHQQD27l5vt74DNJuqsXTZtrQlzUiiptKTV7mjFckF7mG04d1J/0GcVcxjpRZa3rp85KymQKWTsuWJYrCWSeVh+SMwUAbMZ3/vhEKPtrf4rwI+4INTitLuBNfcyH0W+W/rWLBMYoojRW0NJjc+4HJGpkMPbFkDjpde31ZqgI/Cec0GPpqbtsb3DkK/f4mLrR+F59b3+Lj0Cjyh9lM2fVXTrPYt13kdwbtBnNy6x2kdTkEBCk9m+eTFAfJGal+3SwgLeiGQdkjdZ7vSLwwdRf7Qvz5WjxKQ+feFWm+qi0GurWOEaZrubB82CGukxOXKzrvAGN3Eo=
on:
tags: true
condition: $SOURCEDEPLOY