Skip to content

Commit

Permalink
Add Azure builds for Mac and Windows (#24)
Browse files Browse the repository at this point in the history
Move mac builds to Azure and setup builds for GMT 6 as well. Only use
sphinx=1.8.5 in the deploy build to test with the latest sphinx.
  • Loading branch information
leouieda committed Jun 22, 2019
1 parent 6ac5169 commit 660421d
Show file tree
Hide file tree
Showing 3 changed files with 199 additions and 23 deletions.
187 changes: 187 additions & 0 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
# Configuration for Azure Pipelines
########################################################################################

# Only build the master branch, tags, and PRs (on by default) to avoid building random
# branches in the repository until a PR is opened.
trigger:
branches:
include:
- master
- refs/tags/*


jobs:

# Linux
########################################################################################
- job:
displayName: 'Style Checks'

pool:
vmImage: 'ubuntu-16.04'

variables:
CONDA_INSTALL_EXTRA: "black pylint=2.2.2"
PYTHON: '3.7'

steps:

- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'

- bash: echo "##vso[task.prependpath]/usr/share/miniconda/bin"
displayName: Add conda to PATH

# Get the Fatiando CI scripts
- bash: git clone --branch=1.1.1 --depth=1 https://github.com/fatiando/continuous-integration.git
displayName: Fetch the Fatiando CI scripts

# Setup dependencies and build a conda environment
- bash: source continuous-integration/azure/setup-miniconda.sh
displayName: Setup Miniconda

# Show installed pkg information for postmortem diagnostic
- bash: |
set -x -e
source activate testing
conda list
displayName: List installed packages
# Check that the code passes format checks
- bash: |
set -x -e
source activate testing
make check
displayName: Formatting check (black and pylint)
condition: succeededOrFailed()
# Mac
########################################################################################
- job:
displayName: 'Mac'

pool:
vmImage: 'macOS-10.14'

variables:
CONDA_REQUIREMENTS: requirements.txt
CONDA_INSTALL_EXTRA: "sphinx gmt sphinx_rtd_theme numpydoc"

strategy:
matrix:
Python37:
python.version: '3.7'
PYTHON: '3.7'
Python36:
python.version: '3.6'
PYTHON: '3.6'
Python37-GMT6:
python.version: '3.7'
PYTHON: '3.7'
CONDA_INSTALL_EXTRA: "sphinx gmt=6.0.0rc1 sphinx_rtd_theme numpydoc"
CONDA_EXTRA_CHANNEL: "conda-forge/label/dev"

steps:

- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH

# Get the Fatiando CI scripts
- bash: git clone --branch=1.1.1 --depth=1 https://github.com/fatiando/continuous-integration.git
displayName: Fetch the Fatiando CI scripts

# Setup dependencies and build a conda environment
- bash: source continuous-integration/azure/setup-miniconda.sh
displayName: Setup Miniconda

# Show installed pkg information for postmortem diagnostic
- bash: |
set -x -e
source activate testing
conda list
displayName: List installed packages
# Install the package
- bash: |
set -x -e
source activate testing
python setup.py bdist_wheel
pip install dist/*
displayName: Install the package
# Build the documentation
- bash: |
set -x -e
source activate testing
make -C doc clean all
displayName: Build the documentation
# Windows
########################################################################################
- job:
displayName: 'Windows'

pool:
vmImage: 'vs2017-win2016'

variables:
CONDA_REQUIREMENTS: requirements.txt
CONDA_INSTALL_EXTRA: "sphinx gmt sphinx_rtd_theme numpydoc"

strategy:
matrix:
Python37:
python.version: '3.7'
PYTHON: '3.7'
Python36:
python.version: '3.6'
PYTHON: '3.6'
Python37-GMT6:
python.version: '3.7'
PYTHON: '3.7'
CONDA_INSTALL_EXTRA: "sphinx gmt=6.0.0rc1 sphinx_rtd_theme numpydoc"
CONDA_EXTRA_CHANNEL: "conda-forge/label/dev"

steps:

# Install ghostscript separately since there is no Windows conda-forge package for it.
- bash: |
set -x -e
choco install ghostscript
displayName: Install ghostscript via chocolatey
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: Add conda to PATH

# Get the Fatiando CI scripts
- script: git clone --branch=1.1.1 --depth=1 https://github.com/fatiando/continuous-integration.git
displayName: Fetch the Fatiando CI scripts

# Setup dependencies and build a conda environment
- script: continuous-integration/azure/setup-miniconda.bat
displayName: Setup Miniconda

# Show installed pkg information for postmortem diagnostic
- bash: |
set -x -e
source activate testing
conda list
displayName: List installed packages
# Install the package that we want to test
- bash: |
set -x -e
source activate testing
python setup.py sdist --formats=zip
pip install dist/*
displayName: Install the package
# Build the documentation
- bash: |
set -x -e
source activate testing
make -C doc clean all
displayName: Build the documentation
32 changes: 9 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,31 @@ env:
- DEPLOY_DOCS=false
- DEPLOY_PYPI=false
- CONDA_REQUIREMENTS="requirements.txt"
- CONDA_INSTALL_EXTRA="sphinx=1.8.5 gmt sphinx_rtd_theme numpydoc twine"

matrix:
# Build under the following configurations
include:
- os: linux
name: "Style checks"
env:
- PYTHON=3.7
- CHECK=true
- CONDA_INSTALL_EXTRA="black pylint"
- os: linux
name: "Linux - Python 3.6 (deploy)"
name: "Python 3.6 (deploy)"
env:
- PYTHON=3.6
- BUILD_DOCS=true
- DEPLOY_DOCS=true
- DEPLOY_PYPI=true
- CONDA_INSTALL_EXTRA="sphinx=1.8.5 gmt sphinx_rtd_theme numpydoc twine"
- os: linux
name: "Linux - Python 3.7"
name: "Python 3.7"
env:
- PYTHON=3.7
- BUILD_DOCS=true
- os: osx
name: "OSX - Python 3.6"
env:
- PYTHON=3.6
- BUILD_DOCS=true
- os: osx
name: "OSX - Python 3.7"
- CONDA_INSTALL_EXTRA="sphinx gmt sphinx_rtd_theme numpydoc"
- os: linux
name: "Python 3.7 | GMT 6"
env:
- PYTHON=3.7
- BUILD_DOCS=true
- CONDA_INSTALL_EXTRA="sphinx gmt=6.0.0rc1 sphinx_rtd_theme numpydoc"
- CONDA_EXTRA_CHANNEL="conda-forge/label/dev"

before_install:
# Get the Fatiando CI scripts
Expand All @@ -69,14 +61,8 @@ install:
- pip install dist/*

script:
# Check code for style and lint for code quality
- if [ "$CHECK" == "true" ]; then
make check;
fi
# Build the documentation
- if [ "$BUILD_DOCS" == "true" ]; then
make -C doc all;
fi
- make -C doc all

deploy:
# Make a release on PyPI
Expand Down
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ sphinx_gmt
.. image:: http://img.shields.io/travis/GenericMappingTools/sphinx_gmt/master.svg?style=flat-square&label=TravisCI
:alt: Travis CI build status
:target: https://travis-ci.org/GenericMappingTools/sphinx_gmt
.. image:: https://img.shields.io/azure-devops/build/GenericMappingTools/bbb4dc84-4f97-4154-974e-94d185052861/4/master.svg?label=Azure&style=flat-square
:alt: Azure Pipelines build status
:target: https://dev.azure.com/GenericMappingTools/sphinx_gmt/_build
.. image:: https://img.shields.io/pypi/pyversions/sphinx_gmt.svg?style=flat-square
:alt: Compatible Python versions.
:target: https://pypi.python.org/pypi/sphinx_gmt
Expand Down

0 comments on commit 660421d

Please sign in to comment.