Skip to content

Commit 29220bd

Browse files
committed
Merge branch 'master' into sampling/grdtrack
See if things work on GMT 6.0.0rc1 (#311) and Azure Pipelines (#312).
2 parents 1f94896 + d84f308 commit 29220bd

9 files changed

+245
-118
lines changed

.azure-pipelines.yml

Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
# Configuration for Azure Pipelines
2+
########################################################################################
3+
4+
# Only build the master branch, tags, and PRs (on by default) to avoid building random
5+
# branches in the repository until a PR is opened.
6+
trigger:
7+
branches:
8+
include:
9+
- master
10+
- refs/tags/*
11+
12+
13+
jobs:
14+
15+
# Linux
16+
########################################################################################
17+
- job:
18+
displayName: 'Style Checks'
19+
20+
pool:
21+
vmImage: 'ubuntu-16.04'
22+
23+
variables:
24+
CONDA_INSTALL_EXTRA: "black flake8 pylint=2.2.2"
25+
PYTHON: '3.7'
26+
27+
steps:
28+
29+
- task: UsePythonVersion@0
30+
inputs:
31+
versionSpec: '3.7'
32+
33+
- bash: echo "##vso[task.prependpath]/usr/share/miniconda/bin"
34+
displayName: Add conda to PATH
35+
36+
# Get the Fatiando CI scripts
37+
- bash: git clone --branch=1.1.1 --depth=1 https://github.com/fatiando/continuous-integration.git
38+
displayName: Fetch the Fatiando CI scripts
39+
40+
# Setup dependencies and build a conda environment
41+
- bash: source continuous-integration/azure/setup-miniconda.sh
42+
displayName: Setup Miniconda
43+
44+
# Show installed pkg information for postmortem diagnostic
45+
- bash: |
46+
set -x -e
47+
source activate testing
48+
conda list
49+
displayName: List installed packages
50+
51+
# Check that the code passes format checks
52+
- bash: |
53+
set -x -e
54+
source activate testing
55+
make check
56+
displayName: Formatting check (black and flake8)
57+
condition: succeededOrFailed()
58+
59+
# Check that the code passes linting checks
60+
- bash: |
61+
set -x -e
62+
source activate testing
63+
make lint
64+
displayName: Linting (pylint)
65+
condition: succeededOrFailed()
66+
67+
68+
# Mac
69+
########################################################################################
70+
- job:
71+
displayName: 'Mac'
72+
73+
pool:
74+
vmImage: 'macOS-10.14'
75+
76+
variables:
77+
CONDA_REQUIREMENTS: requirements.txt
78+
CONDA_REQUIREMENTS_DEV: requirements-dev.txt
79+
CONDA_INSTALL_EXTRA: "codecov"
80+
CONDA_EXTRA_CHANNEL: "conda-forge/label/dev"
81+
82+
strategy:
83+
matrix:
84+
Python37:
85+
python.version: '3.7'
86+
PYTHON: '3.7'
87+
Python36:
88+
python.version: '3.6'
89+
PYTHON: '3.6'
90+
91+
steps:
92+
93+
- bash: echo "##vso[task.prependpath]$CONDA/bin"
94+
displayName: Add conda to PATH
95+
96+
# Get the Fatiando CI scripts
97+
- bash: git clone --branch=1.1.1 --depth=1 https://github.com/fatiando/continuous-integration.git
98+
displayName: Fetch the Fatiando CI scripts
99+
100+
# Setup dependencies and build a conda environment
101+
- bash: source continuous-integration/azure/setup-miniconda.sh
102+
displayName: Setup Miniconda
103+
104+
# Show installed pkg information for postmortem diagnostic
105+
- bash: |
106+
set -x -e
107+
source activate testing
108+
conda list
109+
displayName: List installed packages
110+
111+
# Install the package
112+
- bash: |
113+
set -x -e
114+
source activate testing
115+
python setup.py bdist_wheel
116+
pip install dist/*
117+
displayName: Install the package
118+
119+
# Run the tests
120+
- bash: |
121+
set -x -e
122+
source activate testing
123+
make test PYTEST_EXTRA="-r P"
124+
displayName: Test
125+
126+
# Build the documentation
127+
- bash: |
128+
set -x -e
129+
source activate testing
130+
make -C doc clean all
131+
displayName: Build the documentation
132+
133+
# Upload test coverage if there were no failures
134+
- bash: |
135+
set -x -e
136+
source activate testing
137+
coverage xml
138+
echo "Uploading coverage to Codecov"
139+
codecov -e PYTHON AGENT_OS
140+
env:
141+
CODECOV_TOKEN: $(codecov.token)
142+
condition: succeeded()
143+
displayName: Upload coverage
144+
145+
146+
# Windows
147+
########################################################################################
148+
- job:
149+
displayName: 'Windows'
150+
151+
pool:
152+
vmImage: 'vs2017-win2016'
153+
154+
variables:
155+
CONDA_REQUIREMENTS: requirements.txt
156+
CONDA_REQUIREMENTS_DEV: requirements-dev.txt
157+
CONDA_INSTALL_EXTRA: "codecov"
158+
CONDA_EXTRA_CHANNEL: "conda-forge/label/dev"
159+
160+
strategy:
161+
matrix:
162+
Python37:
163+
python.version: '3.7'
164+
PYTHON: '3.7'
165+
Python36:
166+
python.version: '3.6'
167+
PYTHON: '3.6'
168+
169+
steps:
170+
171+
# Install ghostscript separately since there is no Windows conda-forge package for it.
172+
- bash: |
173+
set -x -e
174+
choco install ghostscript
175+
displayName: Install ghostscript via chocolatey
176+
177+
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
178+
displayName: Add conda to PATH
179+
180+
# Get the Fatiando CI scripts
181+
- script: git clone --branch=1.1.1 --depth=1 https://github.com/fatiando/continuous-integration.git
182+
displayName: Fetch the Fatiando CI scripts
183+
184+
# Setup dependencies and build a conda environment
185+
- script: continuous-integration/azure/setup-miniconda.bat
186+
displayName: Setup Miniconda
187+
188+
# Show installed pkg information for postmortem diagnostic
189+
- bash: |
190+
set -x -e
191+
source activate testing
192+
conda list
193+
displayName: List installed packages
194+
195+
# Install the package that we want to test
196+
- bash: |
197+
set -x -e
198+
source activate testing
199+
python setup.py sdist --formats=zip
200+
pip install dist/*
201+
displayName: Install the package
202+
203+
# Run the tests
204+
- bash: |
205+
set -x -e
206+
source activate testing
207+
make test PYTEST_EXTRA="-r P"
208+
displayName: Test
209+
210+
# Upload test coverage if there were no failures
211+
- bash: |
212+
set -x -e
213+
source activate testing
214+
coverage report -m
215+
coverage xml
216+
codecov -e PYTHON AGENT_OS
217+
env:
218+
CODECOV_TOKEN: $(codecov.token)
219+
condition: succeeded()
220+
displayName: Upload coverage

.travis.yml

Lines changed: 12 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ language: generic
66
# Use the container builds so we don't need sudo privileges
77
sudo: false
88

9-
cache:
10-
directories:
11-
- gmt-master/build
12-
139
# Only build pushes to the master branch and tags. This avoids the double
1410
# builds than happen when working on a branch instead of a fork.
1511
branches:
@@ -18,35 +14,6 @@ branches:
1814
# Regex to build tagged commits with version numbers
1915
- /\d+\.\d+(\.\d+)?(\S*)?$/
2016

21-
# Set the Ubuntu version for the Linux builds
22-
dist: xenial
23-
24-
# GMT dependencies for the Linux and OSX builds
25-
addons:
26-
apt:
27-
packages:
28-
- cmake
29-
- build-essential
30-
- ninja-build
31-
- libcurl4-gnutls-dev
32-
- libnetcdf-dev
33-
- libgdal-dev
34-
- libfftw3-dev
35-
- libpcre3-dev
36-
- liblapack-dev
37-
- ghostscript
38-
- curl
39-
homebrew:
40-
packages:
41-
- cmake
42-
- ninja
43-
- netcdf
44-
- gdal
45-
- fftw
46-
- pcre2
47-
- ghostscript
48-
- curl
49-
5017
# Define environment variables common to all builds
5118
env:
5219
global:
@@ -56,67 +23,29 @@ env:
5623
# TWINE_PASSWORD to deploy to PyPI
5724
- secure: "md4fgPt9RC/sCoN5//5PcNHLUd9gWQGewV5hFpWW88MRTjxTng1Zfs8r7SqlF2AkEEepFfyzq0BEe9c3FMAnFbec3KmqdlQen4V8xDbLrcTlvkPlTrYGbAScUvdhhqojB//hMHoTD4KvxAv9CiUwFBO4hCMmj2buWHUbV9Ksu5WCW9mF/gkt/hIuYAU6Mbwt8PiYyMgUpzMHO1vruofcWRaVnvKwmBqHB0ae86D4/drpwn4CWjlM12WUnphT2bssiyPkw24FZtCN6kPVta6bLZKBxu0bZpw2vbXuUG+Yh19Q4mp8wNYT3XSHJf8Hl5LfujF48+cLWu+6rlCkdcelyVylhWLFc3rGOONAv4G8jWW2yNSz/bLQfJnMpd81fQEu5eySmFxB7mdB0uyKpvIG1jMJQ73LlYKakKLAPdYhMFyQAHoX9gvCE3S4QR95DBMi5gM/pZubOCcMLdjPHB5JKpJHSjxbOzyVwgmsUIEgd5Bi2vZvvYQXn1plk4xpQ3PhXc+/gi33bzY89mKcfOn0HJ2pD1vLqDXRCBsMCakoLZ0JB/6bacaz4FngbsGWuQ+I1cz20lJGL/MSi9bW1G7Uoidt3GXXWDmXrWt70vIXlLIxr8XV0Mu/rPbauGgWE+ZSYEfvdM5sP+FNF7vQ5de+Fkvzg5Z3tTfR+O1W+d7+vM4="
5825
- TWINE_USERNAME=Leonardo.Uieda
59-
# Paths for GMT installation
60-
- INSTALLDIR="$HOME/gmt-install-dir"
61-
- COASTLINEDIR="$INSTALLDIR/coast"
62-
- PATH="$INSTALLDIR/bin:$PATH"
63-
- LD_LIBRARY_PATH="$INSTALLDIR/lib:$LD_LIBRARY_PATH"
64-
- GMT_LIBRARY_PATH="$INSTALLDIR/lib"
6526
# The file with the listed requirements to be installed by conda
6627
- CONDA_REQUIREMENTS=requirements.txt
6728
- CONDA_REQUIREMENTS_DEV=requirements-dev.txt
29+
- CONDA_INSTALL_EXTRA="codecov twine"
30+
# Enable the development channel so we can get GMT 6.0.0 before it's released
31+
- CONDA_EXTRA_CHANNEL=conda-forge/label/dev
6832
# These variables control which actions are performed in a build
69-
- TEST=false
70-
- CHECK=false
71-
- BUILD_DOCS=false
72-
- DEPLOY_DOCS=false
73-
- DEPLOY_PYPI=false
33+
- DEPLOY=false
7434

7535
matrix:
7636
# Build under the following configurations
7737
include:
78-
- name: "Style checks"
79-
os: linux
80-
env:
81-
- PYTHON=3.6
82-
- CHECK=true
83-
- CONDA_INSTALL_EXTRA="black flake8 pylint=2.2.2"
84-
- CONDA_REQUIREMENTS=""
85-
- CONDA_REQUIREMENTS_DEV=""
8638
- name: "Linux - Python 3.7"
8739
os: linux
8840
env:
8941
- PYTHON=3.7
90-
- TEST=true
91-
- BUILD_DOCS=true
9242
- name: "Linux - Python 3.6 (deploy)"
9343
os: linux
9444
env:
9545
- PYTHON=3.6
96-
- TEST=true
97-
- BUILD_DOCS=true
98-
- DEPLOY_DOCS=true
99-
- DEPLOY_PYPI=true
100-
- CONDA_INSTALL_EXTRA="twine"
101-
- name: "Mac - Python 3.7"
102-
os: osx
103-
env:
104-
- PYTHON=3.7
105-
- TEST=true
106-
- BUILD_DOCS=true
107-
- name: "Mac - Python 3.6"
108-
os: osx
109-
env:
110-
- PYTHON=3.6
111-
- TEST=true
112-
- BUILD_DOCS=true
46+
- DEPLOY=true
11347

11448
before_install:
115-
# Build and install GMT from the master branch
116-
- if [ "$TEST" == "true" ]; then
117-
bash helpers/build-gmt-master.sh;
118-
fi
119-
- cd "$TRAVIS_BUILD_DIR"
12049
# Get the Fatiando CI scripts
12150
- git clone --branch=1.1.1 --depth=1 https://github.com/fatiando/continuous-integration.git
12251
# Download and install miniconda and setup dependencies
@@ -131,51 +60,38 @@ install:
13160
- pip install dist/*
13261

13362
script:
134-
# Check code for style and lint for code quality
135-
- if [ "$CHECK" == "true" ]; then
136-
make check;
137-
make lint;
138-
fi
13963
# Run the test suite. Make pytest report any captured output on stdout or stderr.
140-
- if [ "$TEST" == "true" ]; then
141-
pip install codecov;
142-
make test PYTEST_EXTRA="-r P";
143-
fi
64+
- make test PYTEST_EXTRA="-r P"
14465
# Build the documentation
145-
- if [ "$BUILD_DOCS" == "true" ]; then
146-
make -C doc all;
147-
fi
66+
- make -C doc all
14867

14968
# Things to do if the build is successful
15069
after_success:
15170
# Upload coverage information
152-
- if [ "$TEST" == "true" ]; then
153-
coverage xml;
154-
echo "Uploading coverage to Codecov";
155-
codecov -e PYTHON;
156-
fi
71+
- coverage xml
72+
- codecov -e PYTHON
15773

15874
deploy:
15975
# Make a release on PyPI
16076
- provider: script
16177
script: continuous-integration/travis/deploy-pypi.sh
16278
on:
16379
tags: true
164-
condition: '$DEPLOY_PYPI == "true"'
80+
condition: '$DEPLOY == "true"'
16581
# Push the built HTML in doc/_build/html to the gh-pages branch
16682
- provider: script
16783
script: continuous-integration/travis/deploy-gh-pages.sh
16884
skip_cleanup: true
16985
on:
17086
branch: master
171-
condition: '$DEPLOY_DOCS == "true"'
87+
condition: '$DEPLOY == "true"'
17288
# Push HTML when building tags as well
17389
- provider: script
17490
script: continuous-integration/travis/deploy-gh-pages.sh
17591
skip_cleanup: true
17692
on:
17793
tags: true
178-
condition: '$DEPLOY_DOCS == "true"'
94+
condition: '$DEPLOY == "true"'
17995

18096
notifications:
18197
email: false

0 commit comments

Comments
 (0)