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

CI with GitHub Actions #55

Merged
merged 22 commits into from
Jan 2, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# .coveragerc to control coverage.py
[run]
branch = True
source = spreg

[report]
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain about missing debug-only code:
def __repr__
if self\.debug

# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError

# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:

ignore_errors = True
omit =
*/tests/*
*__init__.py

[html]
directory = coverage_html_report
2 changes: 1 addition & 1 deletion .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
strategy:
matrix:
os: ['ubuntu-latest']
environment-file: [ci/37-GIT-PLUS.yaml]
environment-file: [ci/38-GIT-PLUS.yaml]
experimental: [false]
defaults:
run:
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
schedule:
- cron: '59 23 * * *'

jobs:
unittests:
name: conda (${{ matrix.os }}, ${{ matrix.environment-file }})
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
############################################ replace above with this chunk when Windows testing gets worked out
#os: [macos-latest, ubuntu-latest, windows-latest]
############################################
environment-file: [ci/36-GIT.yaml, ci/36-PYPI.yaml, ci/36-GIT-PLUS.yaml, ci/36-PYPI-PLUS.yaml, ci/37-GIT.yaml, ci/37-PYPI.yaml, ci/37-GIT-PLUS.yaml, ci/37-PYPI-PLUS.yaml, ci/38-GIT.yaml, ci/38-PYPI.yaml, ci/38-GIT-PLUS.yaml, ci/38-PYPI-PLUS.yaml]
############################################ replace above with this chunk when Python 3.9 dependecies get worked out
#environment-file: [ci/36-GIT.yaml, ci/36-PYPI.yaml, ci/36-GIT-PLUS.yaml, ci/36-PYPI-PLUS.yaml, ci/37-GIT.yaml, ci/37-PYPI.yaml, ci/37-GIT-PLUS.yaml, ci/37-PYPI-PLUS.yaml, ci/38-GIT.yaml, ci/38-PYPI.yaml, ci/38-GIT-PLUS.yaml, ci/38-PYPI-PLUS.yaml, ci/39-GIT.yaml, ci/39-PYPI.yaml, ci/39-GIT-PLUS.yaml, ci/39-PYPI-PLUS.yaml]
############################################
############################################ uncomment this chunk when Windows testing gets worked out
#exclude:
# - environment-file: ci/36-PYPI-PLUS.yaml
# os: windows-latest
# - environment-file: ci/36-GIT-PLUS.yaml
# os: windows-latest
############################################
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
env:
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ matrix.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles(matrix.environment-file) }}
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: 'latest'
mamba-version: '*'
channels: conda-forge
channel-priority: true
auto-update-conda: false
auto-activate-base: false
environment-file: ${{ matrix.environment-file }}
activate-environment: test
use-only-tar-bz2: true
- run: mamba info --all
- run: mamba list
- run: conda config --show-sources
- run: conda config --show
- run: pytest -v spreg --cov=spreg --cov-config=.coveragerc --cov-report=xml
############################################## replace above with this chunk when docstring testing gets worked out
#- run: pytest -v spreg --cov=spreg --doctest-modules --cov-config=.coveragerc --cov-report=xml
##############################################
- name: codecov (${{ matrix.os }}, ${{ matrix.environment-file }})
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
name: spreg-codecov
76 changes: 0 additions & 76 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# spreg

[![Build Status](https://travis-ci.com/pysal/spreg.svg?branch=master)](https://travis-ci.com/pysal/spreg)
[![Coverage Status](https://coveralls.io/repos/github/pysal/spreg/badge.svg?branch=master)](https://coveralls.io/github/pysal/spreg?branch=master&service=github)
[![unittests](https://github.com/pysal/spreg/workflows/.github/workflows/unittests.yml/badge.svg)](https://github.com/pysal/spreg/actions?query=workflow%3A.github%2Fworkflows%2Funittests.yml)
[![codecov](https://codecov.io/gh/pysal/spreg/branch/master/graph/badge.svg?token=9VrJpIYIl3)](https://codecov.io/gh/pysal/spreg)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/spreg)
![PyPI](https://img.shields.io/pypi/v/spreg)
![Conda (channel only)](https://img.shields.io/conda/vn/conda-forge/spreg)
Expand Down
29 changes: 29 additions & 0 deletions ci/36-GIT-PLUS.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: test
channels:
- conda-forge
dependencies:
- python=3.6
# required
- numpy>=1.3
- pandas>=1.0
- scipy>=0.11
# testing/formatting
- codecov
- pytest
- pytest-cov
# optional
- bokeh>=0.11.1
- folium>=0.2.1
- geopandas>=0.2
- geojson>=1.3.2
- matplotlib>=1.5.1
- mplleaflet>=0.0.5
- numba
- numexpr
- scikit-learn>=0.17.1
- seaborn>=0.7.0
- statsmodels>=0.6.1
# required
- pip
- pip:
- git+https://github.com/pysal/libpysal.git@master
17 changes: 17 additions & 0 deletions ci/36-GIT.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: test
channels:
- conda-forge
dependencies:
- python=3.6
# required
- numpy>=1.3
- pandas>=1.0
- scipy>=0.11
# testing/formatting
- codecov
- pytest
- pytest-cov
# required
- pip
- pip:
- git+https://github.com/pysal/libpysal.git@master
26 changes: 26 additions & 0 deletions ci/36-PYPI-PLUS.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: test
channels:
- conda-forge
dependencies:
- python=3.6
# required
- libpysal
- numpy>=1.3
- pandas>=1.0
- scipy>=0.11
# testing/formatting
- codecov
- pytest
- pytest-cov
# optional
- bokeh>=0.11.1
- folium>=0.2.1
- geopandas>=0.2
- geojson>=1.3.2
- matplotlib>=1.5.1
- mplleaflet>=0.0.5
- numba
- numexpr
- scikit-learn>=0.17.1
- seaborn>=0.7.0
- statsmodels>=0.6.1
14 changes: 14 additions & 0 deletions ci/36-PYPI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: test
channels:
- conda-forge
dependencies:
- python=3.6
# required
- libpysal
- numpy>=1.3
- pandas>=1.0
- scipy>=0.11
# testing/formatting
- codecov
- pytest
- pytest-cov
6 changes: 0 additions & 6 deletions ci/37-GIT-PLUS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ dependencies:
- scikit-learn>=0.17.1
- seaborn>=0.7.0
- statsmodels>=0.6.1
# for docs build action (this env only)
- nbsphinx
- numpydoc
- sphinx>=1.4.3
- sphinxcontrib-bibtex<2.0.0
- sphinx_bootstrap_theme
# required
- pip
- pip:
Expand Down
17 changes: 17 additions & 0 deletions ci/37-GIT.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: test
channels:
- conda-forge
dependencies:
- python=3.7
# required
- numpy>=1.3
- pandas>=1.0
- scipy>=0.11
# testing/formatting
- codecov
- pytest
- pytest-cov
# required
- pip
- pip:
- git+https://github.com/pysal/libpysal.git@master
26 changes: 26 additions & 0 deletions ci/37-PYPI-PLUS.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: test
channels:
- conda-forge
dependencies:
- python=3.7
# required
- libpysal
- numpy>=1.3
- pandas>=1.0
- scipy>=0.11
# testing/formatting
- codecov
- pytest
- pytest-cov
# optional
- bokeh>=0.11.1
- folium>=0.2.1
- geopandas>=0.2
- geojson>=1.3.2
- matplotlib>=1.5.1
- mplleaflet>=0.0.5
- numba
- numexpr
- scikit-learn>=0.17.1
- seaborn>=0.7.0
- statsmodels>=0.6.1
14 changes: 14 additions & 0 deletions ci/37-PYPI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: test
channels:
- conda-forge
dependencies:
- python=3.7
# required
- libpysal
- numpy>=1.3
- pandas>=1.0
- scipy>=0.11
# testing/formatting
- codecov
- pytest
- pytest-cov
35 changes: 35 additions & 0 deletions ci/38-GIT-PLUS.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: test
channels:
- conda-forge
dependencies:
- python=3.8
# required
- numpy>=1.3
- pandas>=1.0
- scipy>=0.11
# testing/formatting
- codecov
- pytest
- pytest-cov
# optional
- bokeh>=0.11.1
- folium>=0.2.1
- geopandas>=0.2
- geojson>=1.3.2
- matplotlib>=1.5.1
- mplleaflet>=0.0.5
- numba
- numexpr
- scikit-learn>=0.17.1
- seaborn>=0.7.0
- statsmodels>=0.6.1
# for docs build action (this env only)
- nbsphinx
- numpydoc
- sphinx>=1.4.3
- sphinxcontrib-bibtex<2.0.0
- sphinx_bootstrap_theme
# required
- pip
- pip:
- git+https://github.com/pysal/libpysal.git@master
Loading