Skip to content

Commit

Permalink
Merge pull request #112 from pllim/actions-packed-2
Browse files Browse the repository at this point in the history
TST: Move CI from Azure to Actions
  • Loading branch information
pllim authored May 22, 2020
2 parents 75d9031 + 172ed1c commit d0e796d
Show file tree
Hide file tree
Showing 9 changed files with 199 additions and 204 deletions.
188 changes: 188 additions & 0 deletions .github/workflows/ci_workflows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
name: CI

on:
push:
pull_request:
schedule:
# Weekly Tuesday 6AM build
# * is a special character in YAML so you have to quote this string
- cron: '0 6 * * 2'

env:
PYSYN_CDBS: "http://ssb.stsci.edu/cdbs/"

jobs:
pep_and_audit:
runs-on: ubuntu-16.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Fetch tags
run: git fetch --prune --unshallow --tags
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Lint with flake8
run: |
python -m pip install --upgrade pip flake8
flake8 stsynphot --count
# Make sure that packaging will work
- name: pep517 build
run: |
python -m pip install --upgrade setuptools pep517 twine
python -m pep517.build --source .
twine check dist/*
- name: Security audit
run: |
python -m pip install --upgrade bandit
bandit -r . -c .bandit.yaml
initial_tests:
runs-on: ubuntu-16.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Fetch tags
run: git fetch --prune --unshallow --tags
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Install and build
run: |
sudo apt-get install libxml2-utils
python -m pip install --upgrade pip setuptools
python -m pip install -e .[test]
- name: Test without optional deps
run: pytest --open-files

coverage_tests:
runs-on: ubuntu-latest
needs: [pep_and_audit, initial_tests]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Fetch tags
run: git fetch --prune --unshallow --tags
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install and build
run: |
sudo apt-get install libxml2-utils
python -m pip install --upgrade pip setuptools pytest-cov codecov
python -m pip install -e .[test,all]
# NOTE: If CDBS cannot take the hit, disable --remote-data
- name: Test with coverage
run: pytest --cov=./ --cov-report=xml --open-files --remote-data
- name: Coverage report
uses: codecov/codecov-action@f532c3a # v1.0.7
with:
token: ${{ secrets.CODECOV_TOKEN }}

dev_deps_tests:
runs-on: ubuntu-latest
needs: [pep_and_audit, initial_tests]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Fetch tags
run: git fetch --prune --unshallow --tags
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install and build
run: |
sudo apt-get install libxml2-utils
python -m pip install --upgrade pip setuptools
python -m pip install git+https://github.com/astropy/astropy.git@master#egg=astropy
python -m pip install git+https://github.com/spacetelescope/synphot_refactor.git@master#egg=synphot
python -m pip install -e .[test]
- name: Test with dev deps
run: pytest --open-files

old_deps_tests:
runs-on: ubuntu-16.04
needs: [pep_and_audit, initial_tests]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Fetch tags
run: git fetch --prune --unshallow --tags
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.6'
- name: Install and build
run: |
sudo apt-get install libxml2-utils
python -m pip install --upgrade pip setuptools
python -m pip install numpy==1.16.6
python -m pip install scipy==1.1.0
python -m pip install astropy==3.2.2
python -m pip install synphot==0.2.1
python -m pip install -e .[test]
- name: Test with old deps
run: pytest --open-files

windows:
runs-on: windows-latest
needs: [pep_and_audit, initial_tests]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Fetch tags
run: git fetch --prune --unshallow --tags
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install and build
run: |
python -m pip install --upgrade pip setuptools scipy
python -m pip install -e .[test]
# NOTE: If CDBS cannot take the hit, disable --remote-data
- name: Run tests
run: pytest --open-files --remote-data

osx:
runs-on: macos-latest
needs: [pep_and_audit, initial_tests]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Fetch tags
run: git fetch --prune --unshallow --tags
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install and build
run: |
python -m pip install --upgrade pip setuptools scipy
python -m pip install -e .[test]
- name: Run tests
run: pytest --open-files

link_check:
runs-on: ubuntu-latest
needs: [pep_and_audit, initial_tests]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install and build
run: |
python -m pip install --upgrade pip setuptools sphinx-astropy
python -m pip install -e .
- name: Docs link check
run: |
cd docs
make linkcheck
shell: bash
5 changes: 2 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ stsynphot
:target: http://stsynphot.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

.. image:: https://dev.azure.com/spacetelescope/stsynphot_refactor/_apis/build/status/spacetelescope.stsynphot_refactor?branchName=master
:target: https://dev.azure.com/spacetelescope/stsynphot_refactor/_build/latest?definitionId=10&branchName=master
:alt: Build Status
.. image:: https://github.com/spacetelescope/stsynphot_refactor/workflows/CI/badge.svg
:alt: Github Actions CI Status

.. image:: https://codecov.io/gh/spacetelescope/stsynphot_refactor/branch/master/graph/badge.svg
:target: https://codecov.io/gh/spacetelescope/stsynphot_refactor
Expand Down
133 changes: 0 additions & 133 deletions azure-pipelines.yml

This file was deleted.

53 changes: 0 additions & 53 deletions azure-templates.yml

This file was deleted.

Loading

0 comments on commit d0e796d

Please sign in to comment.