forked from GenericMappingTools/pygmt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
190 lines (176 loc) · 6.96 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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# Configuration file for TravisCI
# We use miniconda for Python so don't need any Python specific tools
language: generic
# Use the container builds so we don't need sudo priviledges
sudo: false
cache:
directories:
- gmt-master/build
# Only build pushes to the master branch and tags. This avoids the double
# builds than happen when working on a branch instead of a fork.
branches:
only:
- master
# Regex to build tagged commits with version numbers
- /\d+\.\d+(\.\d+)?(\S*)?$/
# Set the Ubuntu version for the Linux builds
dist: xenial
# GMT dependencies for the Linux and OSX builds
addons:
apt:
packages:
- cmake
- build-essential
- ninja-build
- libcurl4-gnutls-dev
- libnetcdf-dev
- libgdal-dev
- libfftw3-dev
- libpcre3-dev
- liblapack-dev
- ghostscript
- curl
homebrew:
packages:
- cmake
- ninja
- netcdf
- gdal
- fftw
- pcre2
- ghostscript
- curl
# Define environment variables common to all builds
env:
global:
# Encrypted variables
# Github Token for pushing the built docs (GH_TOKEN)
- secure: "QII0477v0mmCCW3qSNXLCOtqraJaCICtSghiyrxYsuUdJTrXzXBNhX2KLIjcKYXOK1HdwYOFGf8xBVLl44clHlAW7R32ecEGeTJizr0yqTBvT3rNG1Xb7+E6jdXqrIs//PmPR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k4xpQ3PhXc+/gi33bzY89mKcfOn0HJ2pD1vLqDXRCBsMCakoLZ0JB/6bacaz4FngbsGWuQ+I1cz20lJGL/MSi9bW1G7Uoidt3GXXWDmXrWt70vIXlLIxr8XV0Mu/rPbauGgWE+ZSYEfvdM5sP+FNF7vQ5de+Fkvzg5Z3tTfR+O1W+d7+vM4="
- TWINE_USERNAME=Leonardo.Uieda
# Paths for GMT installation
- INSTALLDIR="$HOME/gmt-install-dir"
- COASTLINEDIR="$INSTALLDIR/coast"
- PATH="$INSTALLDIR/bin:$PATH"
- LD_LIBRARY_PATH="$INSTALLDIR/lib:$LD_LIBRARY_PATH"
- GMT_LIBRARY_PATH="$INSTALLDIR/lib"
# The file with the listed requirements to be installed by conda
- CONDA_REQUIREMENTS=requirements.txt
- CONDA_REQUIREMENTS_DEV=requirements-dev.txt
# These variables control which actions are performed in a build
- TEST=false
- CHECK=false
- BUILD_DOCS=false
- DEPLOY_DOCS=false
- DEPLOY_PYPI=false
matrix:
# Build under the following configurations
include:
- name: "Style checks"
os: linux
env:
- PYTHON=3.6
- CHECK=true
- CONDA_INSTALL_EXTRA="black flake8 pylint=2.2.2"
- CONDA_REQUIREMENTS=""
- CONDA_REQUIREMENTS_DEV=""
- name: "Linux - Python 3.7"
os: linux
env:
- PYTHON=3.7
- TEST=true
- BUILD_DOCS=true
- name: "Linux - Python 3.6 (deploy)"
os: linux
env:
- PYTHON=3.6
- TEST=true
- BUILD_DOCS=true
- DEPLOY_DOCS=true
- DEPLOY_PYPI=true
- CONDA_INSTALL_EXTRA="twine"
- name: "Mac - Python 3.7"
os: osx
env:
- PYTHON=3.7
- TEST=true
- BUILD_DOCS=true
- name: "Mac - Python 3.6"
os: osx
env:
- PYTHON=3.6
- TEST=true
- BUILD_DOCS=true
before_install:
# Build and install GMT from the master branch
- if [ "$TEST" == "true" ]; then
bash helpers/build-gmt-master.sh;
fi
- cd "$TRAVIS_BUILD_DIR"
# Get the Fatiando CI scripts
- git clone --branch=1.0.0 --depth=1 https://github.com/fatiando/continuous-integration.git
# Download and install miniconda and setup dependencies
# Need to source the script to set the PATH variable globaly
- source continuous-integration/travis/setup-miniconda.sh
# Install the latest master of sphinx-gallery to use the scapper
- pip install --upgrade git+https://github.com/sphinx-gallery/sphinx-gallery.git
# Show installed pkg information for postmortem diagnostic
- conda list
install:
# Package and install
- python setup.py bdist_wheel
- pip install dist/*
script:
# Check code for style and lint for code quality
- if [ "$CHECK" == "true" ]; then
make check;
make lint;
fi
# Run the test suite. Make pytest report any captured output on stdout or stderr.
- if [ "$TEST" == "true" ]; then
pip install codecov;
make test PYTEST_EXTRA="-r P";
fi
# Build the documentation
- if [ "$BUILD_DOCS" == "true" ]; then
make -C doc all;
fi
# Things to do if the build is successful
after_success:
# Upload coverage information
- if [ "$TEST" == "true" ]; then
coverage xml;
echo "Uploading coverage to Codecov";
codecov -e PYTHON;
fi
deploy:
# Make a release on PyPI
- provider: script
script: continuous-integration/travis/deploy-pypi.sh
on:
tags: true
condition: '$DEPLOY_PYPI == "true"'
# Push the built HTML in doc/_build/html to the gh-pages branch
- provider: script
script: continuous-integration/travis/deploy-gh-pages.sh
skip_cleanup: true
on:
branch: master
condition: '$DEPLOY_DOCS == "true"'
# Push HTML when building tags as well
- provider: script
script: continuous-integration/travis/deploy-gh-pages.sh
skip_cleanup: true
on:
tags: true
condition: '$DEPLOY_DOCS == "true"'
notifications:
email: false
webhooks:
# Integration for Gitter
urls:
- https://webhooks.gitter.im/e/648c8355310c2ef3df4f
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: never # options: [always|never|change] default: always