Skip to content

Commit

Permalink
CI: add more github actions (#86)
Browse files Browse the repository at this point in the history
* add test workflow

* fix lint workflow triggered twice

* fix env file not found

* pytest output in colors

* custom matrix builds

* add xarray-dev and attrs-dev to test matrix

* add coveralls

* fix if line

* try fix coverage data sent to coveralls

* use python-coveralls instead of the github action

see
coverallsapp/github-action#4 (comment)

* run coveralls only for py37 environment

* build only docs on travis

* install pytest-cov and converalls using conda

* try fix coveralls command not found

* add doc workflow

* switch to codecov

* add codecov config

* codecov comment still shown?

* use codecov action

* update badges

* update release notes

* remove travis yaml

* gitignore mypy cache
  • Loading branch information
benbovy committed Mar 12, 2020
1 parent 626ffcc commit 5032c14
Show file tree
Hide file tree
Showing 13 changed files with 133 additions and 80 deletions.
10 changes: 10 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
coverage:
status:
project:
default:
target: auto
threshold: 2%
patch: false
changes: false

comment: false
40 changes: 40 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: doc

on:
pull_request:
branches:
- 'master'

jobs:
doc:
name: sphinx
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install miniconda
uses: goanpeca/setup-miniconda@v1
with:
auto-update-conda: true
activate-environment: xarray-simlab-doc
environment-file: ci/requirements/doc.yml
auto-activate-base: false
- name: Install RDT sphinx theme
shell: bash -l {0}
run: conda install -c conda-forge sphinx_rtd_theme
- name: Conda info
shell: bash -l {0}
run: conda info
- name: Conda list
shell: bash -l {0}
run: conda list
- name: Install xarray-simlab
shell: bash -l {0}
run: |
pip install --no-deps -e .
python -OO -c "import xsimlab"
- name: Build doc
shell: bash -l {0}
run: |
cd doc
sphinx-build -n -j auto -b html -d _build/doctrees . _build/html
12 changes: 9 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
name: lint

on: [push, pull_request]
on:
push:
branches:
- 'master'
pull_request:
branches:
- 'master'

jobs:
build:
lint:
runs-on: ubuntu-latest
name: flake8-black
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: test

on:
push:
branches:
- 'master'
pull_request:
branches:
- 'master'

jobs:
test:
name: pytest (${{ matrix.cfg.env-name }}, ${{ matrix.cfg.os }})
runs-on: ${{ matrix.cfg.os }}
strategy:
fail-fast: false
matrix:
cfg:
- {os: ubuntu-latest, env-name: py36}
- {os: ubuntu-latest, env-name: py37, codecov: true}
- {os: ubuntu-latest, env-name: py38}
- {os: macos-latest, env-name: py37}
- {os: windows-latest, env-name: py37}
- {os: ubuntu-latest, env-name: py37-xarray-dev, allow-failure: true}
- {os: ubuntu-latest, env-name: py37-attrs-dev, allow-failure: true}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install miniconda
uses: goanpeca/setup-miniconda@v1
with:
auto-update-conda: true
activate-environment: test_env_${{ matrix.cfg.env-name }}
environment-file: ci/requirements/${{ matrix.cfg.env-name }}.yml
auto-activate-base: false
- name: Conda info
shell: bash -l {0}
run: conda info
- name: Conda list
shell: bash -l {0}
run: conda list
- name: Install xarray-simlab
shell: bash -l {0}
run: |
pip install --no-deps -e .
python -OO -c "import xsimlab"
- name: Run tests
shell: bash -l {0}
run: pytest xsimlab --cov=xsimlab --cov-report term-missing --cov-report xml --verbose --color=yes
continue-on-error: ${{ matrix.cfg.allow-failure }}
- name: Codecov
if: matrix.cfg.codecov
uses: codecov/codecov-action@v1
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ pip-log.txt
nosetests.xml
.cache

# mypy
.mypy_cache/

# Translations
*.mo

Expand Down
60 changes: 0 additions & 60 deletions .travis.yml

This file was deleted.

8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ xarray's ``Dataset`` structure. It is designed for fast, interactive
and exploratory modeling.

.. _xarray: http://xarray.pydata.org
.. |Build Status| image:: https://travis-ci.org/benbovy/xarray-simlab.svg?branch=master
:target: https://travis-ci.org/benbovy/xarray-simlab
.. |Build Status| image:: https://github.com/benbovy/xarray-simlab/workflows/test/badge.svg?branch=master
:target: https://github.com/benbovy/xarray-simlab/actions?workflow=test
:alt: Build Status
.. |Coverage| image:: https://coveralls.io/repos/github/benbovy/xarray-simlab/badge.svg?branch=master
:target: https://coveralls.io/github/benbovy/xarray-simlab?branch=master
.. |Coverage| image:: https://codecov.io/gh/benbovy/xarray-simlab/branch/master/graphs/badge.svg?branch=master
:target: https://codecov.io/github/benbovy/xarray-simlab?branch=master
:alt: Coverage Status
.. |Doc Status| image:: http://readthedocs.org/projects/xarray-simlab/badge/?version=latest
:target: http://xarray-simlab.readthedocs.io/en/latest/?badge=latest
Expand Down
4 changes: 1 addition & 3 deletions ci/requirements/py36.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ dependencies:
- attrs>=19.2.0
- python=3.6
- pytest
- pytest-cov
- numpy
- xarray
- dask
- graphviz
- python-graphviz
- ipython
- zarr
- pip:
- coveralls
- pytest-cov
4 changes: 2 additions & 2 deletions ci/requirements/py37-attrs-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ channels:
dependencies:
- python=3.7
- pytest
- pytest-cov
- numpy
- xarray
- dask
- zarr
- pip
- pip:
- git+https://github.com/python-attrs/attrs.git
- coveralls
- pytest-cov
4 changes: 2 additions & 2 deletions ci/requirements/py37-xarray-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ dependencies:
- attrs>=19.2.0
- python=3.7
- pytest
- pytest-cov
- numpy
- zarr
- dask
- pip
- pip:
- git+https://github.com/pydata/xarray.git
- coveralls
- pytest-cov
5 changes: 2 additions & 3 deletions ci/requirements/py37.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ dependencies:
- attrs>=19.2.0
- python=3.7
- pytest
- pytest-cov
- numpy
- xarray
- dask
- graphviz
- python-graphviz
- ipython
- codecov
- zarr
- tqdm
- pip:
- coveralls
- pytest-cov
4 changes: 1 addition & 3 deletions ci/requirements/py38.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ dependencies:
- attrs>=19.2.0
- python=3.8
- pytest
- pytest-cov
- numpy
- xarray
- dask
- graphviz
- python-graphviz
- zarr
- pip:
- coveralls
- pytest-cov
6 changes: 6 additions & 0 deletions doc/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ Bug fixes
- Avoid update in-place attributes in original/input xarray Datasets
(:issue:`101`).

Maintenance
~~~~~~~~~~~

- Switched to GitHub Actions for continuous integration and Codecov for
coverage (:issue:`86`).

v0.3.0 (30 September 2019)
--------------------------

Expand Down

0 comments on commit 5032c14

Please sign in to comment.