Skip to content

Commit

Permalink
Change from Travis CI to Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bradyrx committed Oct 1, 2020
1 parent 6625e0a commit 41778fd
Show file tree
Hide file tree
Showing 18 changed files with 177 additions and 97 deletions.
8 changes: 8 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
coverage:
status:
project:
default:
# Require 1% coverage, i.e., always succeed
target: 1
patch: false
changes: false
8 changes: 0 additions & 8 deletions .coveragerc

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/climpred_installs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: climpred installs

on: [push]

jobs:
install-climpred: # Installs climpred on various OS.
name: Install climpred, ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
python -c "import climpred"
61 changes: 61 additions & 0 deletions .github/workflows/climpred_testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: climpred testing

on: [push]

jobs:
test: # Runs testing suite on various python versions.
name: Test climpred, python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
- name: Install Conda environment
uses: conda-incubator/setup-miniconda@v1
with:
auto-update-conda: true
activate-environment: climpred-minimum-tests
environment-file: ci/requirements/minimum-tests.yml
python-version: ${{ matrix.python-version }}
- name: Conda info
shell: bash -l {0}
run: conda info
- name: Conda list
shell: bash -l {0}
run: conda list
- name: Run tests
shell: bash -l {0}
run: |
conda activate climpred-minimum-tests
pytest --cov=climpred --cov-report=xml
- name: Upload coverage to codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
fail_ci_if_error: true

docs_notebooks: # Checks that pre-compiled notebooks in docs still work.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Conda environment
uses: conda-incubator/setup-miniconda@v1
with:
auto-update-conda: true
activate-environment: climpred-docs-notebooks
environment-file: ci/requirements/docs_notebooks.yml
python-version: 3.6
- name: Conda info
shell: bash -l {0}
run: conda info
- name: Conda list
shell: bash -l {0}
run: conda list
- name: Test notebooks in docs
shell: bash -l {0}
run: |
pushd docs
nbstripout source/*.ipynb source/examples/decadal/*.ipynb source/examples/subseasonal/*.ipynb
make html
pop
29 changes: 29 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Lint

on: [push]

jobs:
lint: # Runs linting package checks for code styling.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Install linting dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 black==19.10b0 isort
- name: Lint with flake8
shell: bash -l {0}
run: |
flake8 climpred
- name: Lint with black
shell: bash -l {0}
run: |
black --check climpred
- name: Lint with isort
shell: bash -l {0}
run: |
isort --recursive --check-only climpred
33 changes: 0 additions & 33 deletions .github/workflows/python-package.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ Internals/Minor Fixes
``matplotlib`` version. Update ``xskillscore`` requirement to 0.0.18 to
cooperate with new ``xarray`` version. (:pr:`451`, :pr:`449`)
`Riley X. Brady`_
- Switch from Travis CI and Coveralls to Github Actions and CodeCov.
(:pr:`471`) `Riley X. Brady`_



Expand Down
6 changes: 2 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Verification of weather and climate forecasts.
:target: https://requires.io/github/pangeo-data/climpred/requirements/?branch=master
:alt: Requirements Status

.. |codecov| image:: https://coveralls.io/repos/github/pangeo-data/climpred/badge.svg?branch=master
:target: https://coveralls.io/github/pangeo-data/climpred?branch=master
.. |codecov| image:: https://codecov.io/gh/pangeo-data/climpred/branch/master/graph/badge.svg?token=e53kXaaOqS
:target: https://codecov.io/gh/pangeo-data/climpred

.. |conda| image:: https://img.shields.io/conda/vn/conda-forge/climpred.svg
:target: https://anaconda.org/conda-forge/climpred
Expand Down Expand Up @@ -88,5 +88,3 @@ Documentation
Documentation is in development and can be found on readthedocs_.

.. _readthedocs: https://climpred.readthedocs.io/en/latest/

DELETE THIS
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: climpred-dev
channels:
- conda-forge
dependencies:
- python=3.6
# Documentation
- nbsphinx
- nbstripout
Expand Down
1 change: 1 addition & 0 deletions ci/requirements/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dependencies:
- jupyterlab
- matplotlib
- nbsphinx
- nbstripout
- nc-time-axis
- netcdf4
- numpy
Expand Down
29 changes: 29 additions & 0 deletions ci/requirements/docs_notebooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: climpred-docs-notebooks
channels:
- conda-forge
dependencies:
- xesmf
- esmpy
- bottleneck
- cartopy>=0.18.0
- esmtools>=1.1.3
- importlib_metadata
- jupyterlab
- matplotlib
- nbsphinx
- nbstripout
- nc-time-axis
- netcdf4
- numpy
- pandas
- pygments==2.6.1
- sphinx
- sphinxcontrib-napoleon
- sphinx_rtd_theme
- toolz
- tqdm
- xarray>=0.16.1
- pip
- pip:
# Install latest version of climpred.
- -e ../..
18 changes: 18 additions & 0 deletions ci/requirements/minimum-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: climpred-minimum-tests
channels:
- conda-forge
- defaults
dependencies:
- xesmf
- esmpy
- dask
- netcdf4
- ipython
- nc-time-axis
- coveralls
- pytest
- pytest-cov
- pip
- pip:
- pytest-lazy-fixture
- -e ../..
2 changes: 0 additions & 2 deletions ci/run-linter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ set -eo pipefail

echo "Code Styling with (black, flake8, isort)"

source activate climpred-dev

echo "[flake8]"
flake8 climpred --exclude=__init__.py

Expand Down
6 changes: 1 addition & 5 deletions climpred/tests/test_versioning.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import pytest

from climpred.versioning.print_versions import main, show_versions
from climpred.versioning.print_versions import show_versions


@pytest.mark.parametrize("as_json", [True, False])
def test_show_versions(as_json):
show_versions(as_json=as_json)


def test_main():
main()
1 change: 0 additions & 1 deletion climpred/versioning/print_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ def show_versions(as_json=False):
("setuptools", lambda mod: mod.__version__),
("pip", lambda mod: mod.__version__),
("conda", lambda mod: mod.__version__),
("pytest", lambda mod: mod.__version__),
# Misc.
("IPython", lambda mod: mod.__version__),
("sphinx", lambda mod: mod.__version__),
Expand Down
4 changes: 2 additions & 2 deletions docs/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ documents. Some helpful guides are located

.. code:: bash
$ conda env update -f ci/requirements/environment-dev-3.6.yml
$ conda env update -f ci/requirements/climpred-dev.yml
$ cd docs
$ make html
Expand Down Expand Up @@ -124,7 +124,7 @@ Preparing Pull Requests

#. Install dependencies into a new conda environment::

$ conda env update -f ci/requirements/environment-dev-3.6.yml
$ conda env update -f ci/requirements/climpred-dev.yml
$ conda activate climpred-dev

#. Make an editable install of climpred by running::
Expand Down
4 changes: 2 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ climpred: verification of weather and climate forecasts
:target: https://requires.io/github/pangeo-data/climpred/requirements/?branch=master
:alt: Requirements Status

.. |codecov| image:: https://coveralls.io/repos/github/pangeo-data/climpred/badge.svg?branch=master
:target: https://coveralls.io/github/pangeo-data/climpred?branch=master
.. |codecov| image:: https://codecov.io/gh/pangeo-data/climpred/branch/master/graph/badge.svg?token=e53kXaaOqS
:target: https://codecov.io/gh/pangeo-data/climpred

.. |conda| image:: https://img.shields.io/conda/vn/conda-forge/climpred.svg
:target: https://anaconda.org/conda-forge/climpred
Expand Down

0 comments on commit 41778fd

Please sign in to comment.