Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: Transition Azure Pipelines #74

Merged
merged 1 commit into from Jun 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
115 changes: 0 additions & 115 deletions .travis.yml

This file was deleted.

51 changes: 0 additions & 51 deletions appveyor.yml

This file was deleted.

9 changes: 9 additions & 0 deletions azure-cron.yml
@@ -0,0 +1,9 @@
# This is used for scheduled job that is configured on the
# Azure side.

trigger: none

jobs:
- template: azure-templates.yml
parameters:
name: 'Nightly'
112 changes: 112 additions & 0 deletions azure-pipelines.yml
@@ -0,0 +1,112 @@
# This is the CI matrix that runs per push event.

trigger:
- master

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

# NOTE: If CDBS cannot take the hit, disable --remote-data
- script: |
sudo apt-get install libxml2-utils
python -m pip install --upgrade pip setuptools
pip install numpy scipy beautifulsoup4 astropy pytest-astropy synphot codecov
python setup.py test --coverage --open-files --remote-data
displayName: 'Run tests'

- script: codecov -t $codecov_token
env:
codecov_token: $(CODECOV_TOKEN)
PYSYN_CDBS: http://ssb.stsci.edu/cdbs_open/cdbs/
displayName: 'Calculate coverage'

- template: azure-templates.yml
parameters:
name: 'LTS_Astropy'
numpyCmd: 'pip install numpy==1.15.4'
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'
synphotCmd: 'pip install git+https://github.com/spacetelescope/synphot_refactor.git@master#egg=synphot'

- 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 beautifulsoup4 matplotlib astropy sphinx-astropy synphot
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'
32 changes: 32 additions & 0 deletions azure-templates.yml
@@ -0,0 +1,32 @@
# Azure job template for the most common job in CI.

parameters:
name: 'Default' # Defaults for any parameters that aren't specified
vmImage: 'Ubuntu-16.04'
numpyCmd: 'pip install numpy'
astropyCmd: 'pip install astropy'
synphotCmd: 'pip install synphot'
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
${{ parameters.numpyCmd }}
pip install scipy beautifulsoup4 pytest-astropy
${{ parameters.astropyCmd }}
${{ parameters.synphotCmd }}
python setup.py test --open-files
displayName: 'Run tests'