forked from equinor/segyio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
167 lines (155 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
156
157
158
159
160
161
162
163
164
165
166
167
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 bandit setuptools setuptools-scm pytest pytest-runner sphinx
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
- build_wheel . $PLAT
- install_run $PLAT
- mv wheelhouse 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
- if [[ $SOURCEDEPLOY ]]; then
rm -rf dist;
fi
deploy:
- provider: pypi # source distribution (done from linux python 3.6 only)
skip_cleanup: true
skip_upload_docs: true
user: statoil-travis
password:
secure: WHeA5x2iiXzjYXdgZeJU6l4fawRi/umqH1713QAj0RPZBAnD+9m8Zrpn2UWn9+1dtx6xUMkNg3ZTueVKTKo0f2i/4o0xkzQ5BW11cetCWusV2Dku1btPTA5Fhs+dvPDlL3m496a3Bq/A/fRDj5JLDiiPibvpM01lEBxFKYooWGQ75HVuhnAt57vabD45gDpIE7N23+So4+9bsG/nT/ZlgoaS01uLTdlnf6tjNgP0/UBkonmedC62iVvCu7itfHZMTY2rSeww7KBMI3s7Gz+cyx9IbI3shbDpdJGHpM8Qe+1oFi31Z+DylWQA5SkpHlLMUP+zjMKLF+1hXGNUeJuyadIFrxzbS3vTV2yRPa6ol8q+bX7YLy0xNLSE8aMm54LKgXfRKLc3G8d3I33oEfyk5hygY8iEX728r2TsARslYxOF3sZqJvY8lx4GBEDiXxX2GJvGCPy/Uby786uWnZlFFkDERk3nawE0W68zY0GElbutq6HMSk6v49J7em9Rg/QLptjoa0uF2A9Cy+BAJcnfauIawOG3UPXZ8kD60PTbu8tqtwtXO5lzTSIOr1lt3+6R8GmCc2hz2YXELKvdnZWYCXAjnNuC4eESlp7zxmzhpOVkb2Jy1v6rGKpcxVMggLQbOjOGWPLg9q4+OZQBw5bhMGmVGQhSBuxzEb/wBRy9XV8=
on:
condition: $SOURCEDEPLOY
tags: true
- provider: pypi # upload built wheels
skip_cleanup: true
skip_upload_docs: true
user: statoil-travis
distributions: build
password:
secure: WHeA5x2iiXzjYXdgZeJU6l4fawRi/umqH1713QAj0RPZBAnD+9m8Zrpn2UWn9+1dtx6xUMkNg3ZTueVKTKo0f2i/4o0xkzQ5BW11cetCWusV2Dku1btPTA5Fhs+dvPDlL3m496a3Bq/A/fRDj5JLDiiPibvpM01lEBxFKYooWGQ75HVuhnAt57vabD45gDpIE7N23+So4+9bsG/nT/ZlgoaS01uLTdlnf6tjNgP0/UBkonmedC62iVvCu7itfHZMTY2rSeww7KBMI3s7Gz+cyx9IbI3shbDpdJGHpM8Qe+1oFi31Z+DylWQA5SkpHlLMUP+zjMKLF+1hXGNUeJuyadIFrxzbS3vTV2yRPa6ol8q+bX7YLy0xNLSE8aMm54LKgXfRKLc3G8d3I33oEfyk5hygY8iEX728r2TsARslYxOF3sZqJvY8lx4GBEDiXxX2GJvGCPy/Uby786uWnZlFFkDERk3nawE0W68zY0GElbutq6HMSk6v49J7em9Rg/QLptjoa0uF2A9Cy+BAJcnfauIawOG3UPXZ8kD60PTbu8tqtwtXO5lzTSIOr1lt3+6R8GmCc2hz2YXELKvdnZWYCXAjnNuC4eESlp7zxmzhpOVkb2Jy1v6rGKpcxVMggLQbOjOGWPLg9q4+OZQBw5bhMGmVGQhSBuxzEb/wBRy9XV8=
on:
condition: -z $SOURCEDEPLOY
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