Skip to content

Commit

Permalink
Merge pull request #52 from saimn/github-actions
Browse files Browse the repository at this point in the history
GitHub actions
  • Loading branch information
cmccully committed Nov 18, 2020
2 parents fd4acfe + 94ce65b commit c541dbc
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 192 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Run unit tests

on:
pull_request:
push:
branches: [ master ]
tags:
workflow_dispatch:
schedule:
# Run every Sunday at 03:53 UTC
- cron: 11 2 * * 0

jobs:
tests:
name: ${{ matrix.name }} (${{ matrix.os }}, ${{ matrix.toxenv }})
runs-on: ${{ matrix.os }}
if: "!(contains(github.event.head_commit.message, '[skip ci]') || contains(github.event.head_commit.message, '[ci skip]'))"
strategy:
fail-fast: false
matrix:
include:
- name: Python 3.7 with required dependencies
os: macos-latest
python-version: 3.7
toxenv: py37-test

- name: Python 3.8 with required dependencies and measure coverage
os: ubuntu-latest
python-version: 3.8
toxenv: py38-test
coverage: true

- name: Documentation build
os: ubuntu-latest
python-version: 3.8
toxenv: build_docs

- name: Python 3.8 with developer version of astropy and numpy
os: ubuntu-latest
python-version: 3.8
toxenv: py38-test-devdeps

- name: Python 3.6 astropy LTS and Numpy 1.16
os: ubuntu-latest
python-version: 3.6
toxenv: py36-test-astropylts-numpy116

- name: Python 3.8 with required dependencies
os: windows-latest
python-version: 3.8
toxenv: py38-test

- name: Python 3.7 with older dependencies, astropy 3.0 and Numpy 1.17
os: ubuntu-latest
python-version: 3.7
toxenv: py37-test-astropy30-numpy117

- name: Code style checks
os: ubuntu-latest
python-version: 3.8
toxenv: codestyle

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: python -m pip install tox
- name: Install graphviz dependency
if: "endsWith(matrix.toxenv, 'build_docs')"
run: sudo apt-get -y install graphviz
- name: Run tests
if: "! matrix.coverage"
run: tox -v -e ${{ matrix.toxenv }}
- name: Run tests with coverage
if: "matrix.coverage"
run: |
pip install Cython extension-helpers numpy
COVERAGE=1 pip install -e .[test]
pytest --pyargs astroscrappy docs --cov astroscrappy --cov-report=xml:coverage.xml
- name: Upload coverage to codecov
if: "matrix.coverage"
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
185 changes: 0 additions & 185 deletions .travis.yml

This file was deleted.

5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ Astro-SCRAPPY: The Speedy Cosmic Ray Annihilation Package in Python
:alt: Documentation Status
:scale: 100%
:target: https://astroscrappy.readthedocs.io/en/latest/?badge=latest
.. image:: https://travis-ci.org/astropy/astroscrappy.png
:target: https://travis-ci.org/astropy/astroscrappy
.. image:: https://github.com/astropy/astroscrappy/workflows/Run%20unit%20tests/badge.svg
:target: https://github.com/astropy/astroscrappy/actions
:alt: CI Status
.. image:: https://codecov.io/gh/astropy/astroscrappy/branch/master/graph/badge.svg
:target: https://codecov.io/gh/astropy/astroscrappy
:alt: AstroScrappy's Coverage Status
Expand Down
15 changes: 10 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
[tox]
envlist =
py{36,37,38}-test{,-alldeps,-devdeps}{,-cov}
py{36,37,38}-test-numpy{116,117,118}
py{36,37,38}-test-astropy{30,40,lts}
py{36,37,38,39}-test{,-alldeps,-devdeps}{,-cov}
py{36,37,38,39}-test-numpy{116,117,118,119}
py{36,37,38,39}-test-astropy{30,40,41,lts}
build_docs
linkcheck
codestyle
requires =
setuptools >= 30.3.0
pip >= 19.3.1

isolated_build = true
indexserver =
NIGHTLY = https://pypi.anaconda.org/scipy-wheels-nightly/simple

[testenv]

Expand Down Expand Up @@ -38,21 +39,25 @@ description =
numpy116: with numpy 1.16.*
numpy117: with numpy 1.17.*
numpy118: with numpy 1.18.*
numpy119: with numpy 1.19.*
astropy30: with astropy 3.0.*
astropy40: with astropy 4.0.*
astropy41: with astropy 4.1.*
astropylts: with the latest astropy LTS

# The following provides some specific pinnings for key packages
deps =
numpy116: numpy==1.16.*
numpy117: numpy==1.17.*
numpy118: numpy==1.18.*
numpy119: numpy==1.19.*

astropy30: astropy==3.0.*
astropy40: astropy==4.0.*
astropy41: astropy==4.1.*
astropylts: astropy==4.0.*

devdeps: git+https://github.com/numpy/numpy.git#egg=numpy
devdeps: :NIGHTLY:numpy
devdeps: git+https://github.com/astropy/astropy.git#egg=astropy

# The following indicates which extras_require from setup.cfg will be installed
Expand Down

0 comments on commit c541dbc

Please sign in to comment.