Skip to content

Commit

Permalink
Add Azure stages and template.
Browse files Browse the repository at this point in the history
Remove old README badges.
  • Loading branch information
pllim committed Jun 11, 2019
1 parent 1f69ca7 commit 094cab4
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 205 deletions.
8 changes: 0 additions & 8 deletions README.rst
Expand Up @@ -9,14 +9,6 @@ synphot
:target: https://dev.azure.com/spacetelescope/synphot_refactor/_build/latest?definitionId=2&branchName=master
:alt: Azure CI Status

.. image:: https://travis-ci.org/spacetelescope/synphot_refactor.svg?branch=master
:target: https://travis-ci.org/spacetelescope/synphot_refactor
:alt: Travis CI Status

.. image:: https://ci.appveyor.com/api/projects/status/jc4f77cpng8iyvnd/branch/master?svg=true
:target: https://ci.appveyor.com/project/pllim/synphot-refactor/branch/master
:alt: Appveyor CI Status

.. image:: https://codecov.io/gh/spacetelescope/synphot_refactor/branch/master/graph/badge.svg
:target: https://codecov.io/gh/spacetelescope/synphot_refactor
:alt: Coverage results
Expand Down
300 changes: 103 additions & 197 deletions azure-pipelines.yml
@@ -1,200 +1,106 @@
# Python package
# Create and test a Python package on multiple Python versions.
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python

trigger:
- master

jobs:
- job: 'EggInfo'
pool:
vmImage: 'Ubuntu-16.04'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'
architecture: 'x64'

# Make sure that egg_info works without dependencies
- script: |
python -m pip install --upgrade pip setuptools
python setup.py egg_info
displayName: 'egg_info'
- job: 'Coverage'
pool:
vmImage: 'Ubuntu-16.04'
strategy:
matrix:
Python37:
python.version: '3.7'
maxParallel: 4

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'

- script: |
sudo apt-get install libxml2-utils
python -m pip install --upgrade pip setuptools
pip install numpy scipy astropy pytest-astropy codecov
python setup.py test --coverage --open-files --remote-data
displayName: 'Run tests'
- script: codecov
displayName: 'Calculate coverage'

- job: 'Default'
pool:
vmImage: 'Ubuntu-16.04'
strategy:
matrix:
Python37:
python.version: '3.7'
maxParallel: 4

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'

- script: |
sudo apt-get install libxml2-utils
python -m pip install --upgrade pip setuptools
pip install numpy scipy astropy pytest-astropy
python setup.py test --open-files
displayName: 'Run tests'
- job: 'LTS_Astropy'
pool:
vmImage: 'Ubuntu-16.04'
strategy:
matrix:
Python36:
python.version: '3.6'
maxParallel: 4

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'

- script: |
sudo apt-get install libxml2-utils
python -m pip install --upgrade pip setuptools
pip install numpy scipy astropy==2.0.12 pytest-astropy
python setup.py test --open-files
displayName: 'Run tests'
- job: 'Dev_Astropy'
pool:
vmImage: 'Ubuntu-16.04'
strategy:
matrix:
Python37:
python.version: '3.7'
maxParallel: 4

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'

- script: |
sudo apt-get install libxml2-utils
python -m pip install --upgrade pip setuptools
pip install numpy scipy pytest-astropy
pip install git+https://github.com/astropy/astropy.git@master#egg=astropy
python setup.py test --open-files
displayName: 'Run tests'
- job: 'Windows'
pool:
vmImage: 'vs2017-win2016'
strategy:
matrix:
Python37:
python.version: '3.7'
maxParallel: 4

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'

- script: |
python -m pip install --upgrade pip setuptools
pip install numpy scipy astropy pytest-astropy
python setup.py test --open-files
displayName: 'Run tests'
- job: 'OSX'
pool:
vmImage: 'macOS-10.13'
strategy:
matrix:
Python37:
python.version: '3.7'
maxParallel: 4

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'

- script: |
python -m pip install --upgrade pip setuptools
pip install numpy scipy astropy pytest-astropy
python setup.py test --open-files
displayName: 'Run tests'
- job: 'Doc'
pool:
vmImage: 'Ubuntu-16.04'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.6'
architecture: 'x64'

- script: |
sudo apt-get install graphviz
python -m pip install --upgrade pip setuptools
pip install numpy scipy matplotlib astropy sphinx-astropy
python setup.py build_docs -w
displayName: 'Doc build'
# DEV NOTE:
# Not very useful like this because I have to sign in with Microsoft account,
# download a ZIP file, unzip on local disk, and then only I can preview the
# HTML pages. Was hoping for direct preview by clicking URL like CircleCI.
#
# - task: PublishPipelineArtifact@0
# inputs:
# artifactName: 'htmlDocs'
# targetPath: 'docs/_build/html'

- job: 'PEP8'
pool:
vmImage: 'Ubuntu-16.04'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'
architecture: 'x64'

- script: |
python -m pip install --upgrade pip setuptools
pip install flake8
flake8 synphot --count
displayName: 'PEP 8 check'
stages:
- stage: Initial
jobs:
- job: 'EggInfo'
pool:
vmImage: 'Ubuntu-16.04'

steps:
- task: UsePythonVersion@0

# Make sure that egg_info works without dependencies
- script: |
python -m pip install --upgrade pip setuptools
python setup.py egg_info
displayName: 'egg_info'
- job: 'PEP8'
pool:
vmImage: 'Ubuntu-16.04'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'

- script: |
python -m pip install --upgrade pip setuptools
pip install flake8
flake8 synphot --count
displayName: 'PEP 8 check'
- template: azure-templates.yml

- stage: Comprehensive
dependsOn: Initial
condition: succeeded()
jobs:
- job: 'Coverage'
pool:
vmImage: 'Ubuntu-16.04'
strategy:
maxParallel: 4

steps:
- task: UsePythonVersion@0

- script: |
sudo apt-get install libxml2-utils
python -m pip install --upgrade pip setuptools
pip install numpy scipy astropy pytest-astropy codecov
python setup.py test --coverage --open-files --remote-data
displayName: 'Run tests'
- script: codecov -t $codecov_token
env:
codecov_token: $(CODECOV_TOKEN)
displayName: 'Calculate coverage'

- template: azure-templates.yml
parameters:
name: 'LTS_Astropy'
astropyCmd: 'pip install astropy==2.0.12'
pythonVersion: '3.6'

- template: azure-templates.yml
parameters:
name: 'Dev_Astropy'
astropyCmd: 'pip install git+https://github.com/astropy/astropy.git@master#egg=astropy'

- template: azure-templates.yml
parameters:
name: 'Windows'
vmImage: 'vs2017-win2016'

- template: azure-templates.yml
parameters:
name: 'OSX'
vmImage: 'macOS-10.13'

- job: 'Doc'
pool:
vmImage: 'Ubuntu-16.04'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.6'

- script: |
sudo apt-get install graphviz
python -m pip install --upgrade pip setuptools
pip install numpy scipy matplotlib astropy sphinx-astropy
python setup.py build_docs -w
displayName: 'Doc build'
# DEV NOTE:
# Not very useful like this because I have to sign in with Microsoft account,
# download a ZIP file, unzip on local disk, and then only I can preview the
# HTML pages. Was hoping for direct preview by clicking URL like CircleCI.
#
# - task: PublishPipelineArtifact@0
# inputs:
# artifactName: 'htmlDocs'
# targetPath: 'docs/_build/html'
26 changes: 26 additions & 0 deletions azure-templates.yml
@@ -0,0 +1,26 @@
parameters:
name: 'Default' # Defaults for any parameters that aren't specified
vmImage: 'Ubuntu-16.04'
astropyCmd: 'pip install astropy'
pythonVersion: '3.7'

jobs:
- job: ${{ parameters.name }}
pool:
vmImage: ${{ parameters.vmImage }}
strategy:
maxParallel: 4

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: ${{ parameters.pythonVersion }}
architecture: 'x64'

- script: |
sudo apt-get install libxml2-utils
python -m pip install --upgrade pip setuptools
pip install numpy scipy pytest-astropy
${{ parameters.astropyCmd }}
python setup.py test --open-files
displayName: 'Run tests'

0 comments on commit 094cab4

Please sign in to comment.