Skip to content

Commit

Permalink
Merge pull request #644 from Ouranosinc/use_guthub_ci
Browse files Browse the repository at this point in the history
Use GitHub CI
  • Loading branch information
Zeitsperre authored Feb 16, 2021
2 parents 12b076e + 140d226 commit 2544dde
Show file tree
Hide file tree
Showing 11 changed files with 214 additions and 114 deletions.
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ Before you submit a pull request, please follow these guidelines:
Pull requests are also checked for documentation build status and for `PEP8`_ compliance.

The build statuses and build errors for pull requests can be found at:
https://travis-ci.com/Ouranosinc/xclim/pull_requests
https://github.com/Ouranosinc/xclim/actions

.. warning::
PEP8, Black, Pytest (with xdoctest) and Pydocstyle (for numpy docstrings) conventions are strongly enforced.
PEP8, Black, pytest (with xdoctest) and pydocstyle (for numpy docstrings) conventions are strongly enforced.
Ensure that your changes pass all tests prior to pushing your final commits to your branch.
Code formatting errors are treated as build errors and will block your pull request from being accepted.

Expand Down
94 changes: 94 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: xclim

on:
push:
branches:
- master
pull_request:

jobs:
black:
runs-on: ubuntu-latest
strategy:
matrix:
tox-env: [black]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Install tox
run: pip install tox
- name: Run linting suite
run: tox -e ${{ matrix.tox-env }}

doctests:
runs-on: ubuntu-latest
strategy:
matrix:
tox-env: [doctests]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Install tox
run: pip install tox
- name: Run lint
run: tox -e ${{ matrix.tox-env }}

test:
needs: black
runs-on: ubuntu-latest
strategy:
matrix:
tox-env: [py37-xarray, py38-slow]
python-version: [3.7, 3.8]
exclude:
- tox-env: py37-xarray
python-version: 3.8
- tox-env: py38-slow
python-version: 3.7
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: pip install tox
- name: Test with tox
run: tox -e ${{ matrix.tox-env }}

# docs:
# needs: test
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Install packages
# run: |
# sudo apt-get -y install pandoc
# - uses: actions/setup-python@v2
# with:
# python-version: 3.6
# - name: Install tox
# run: pip install tox
# - name: make docs
# run: tox -e docs

# - name: Coveralls
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# flag-name: run-${{ matrix.python-version }}
# parallel: true

# finish:
# needs: test
# runs-on: ubuntu-latest
# steps:
# - name: Coveralls Finished
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.github_token }}
# parallel-finished: true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ ENV/
# autogenerated RestructuredText
/docs/modules.rst
/docs/xclim.core.rst
/docs/xclim.ensembles.rst
/docs/xclim.indicators.atmos.rst
/docs/xclim.indicators.land.rst
/docs/xclim.indicators.rst
Expand All @@ -119,3 +120,5 @@ ENV/
/docs/xclim.rst
/docs/xclim.sdba.rst
/docs/xclim.testing.rst
/docs/xclim.testing.tests.rst
/docs/xclim.testing.tests.test_sdba.rst
206 changes: 103 additions & 103 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
language: python

os: linux
dist: xenial

branches:
only:
- master
- ^v[0-9]+\.[0-9]+[\.]?[a-c-]?[0-9]?[\w-]+\b

jobs:
fast_finish: true
include:
#language: python
#
#os: linux
#dist: xenial
#
#branches:
# only:
# - master
# - ^v[0-9]+\.[0-9]+[\.]?[a-c-]?[0-9]?[\w-]+\b
#
#jobs:
# fast_finish: true
# include:
# - env:
# - TOXENV=docs
# name: "Documentation"
Expand All @@ -19,15 +19,15 @@ jobs:
# apt:
# packages:
# - pandoc
- env: TOXENV=black
name: "Black, Flake8, Numpy-like Docstring compliance, and linting"
python: 3.6
# - env: TOXENV=black
# name: "Black, Flake8, Numpy-like Docstring compliance, and linting"
# python: 3.6
# - env: TOXENV=py39
# name: "Python3.9 (Linux)"
# python: 3.9
- env: TOXENV=py38-doctest
name: "Python3.8 (Linux) + doctests"
python: 3.8
# - env: TOXENV=py38-doctest
# name: "Python3.8 (Linux) + doctests"
# python: 3.8
# - if: type = push
# env: TOXENV=macOS
# name: "Python3.x (macOS)"
Expand All @@ -48,9 +48,9 @@ jobs:
# - env: TOXENV=py37
# name: "Python3.7 (Linux)"
# python: 3.7
- env: TOXENV=py36-nosubset-lm3
name: "Python3.6 (Linux + lmoments3@master) (no subsetting)"
python: 3.6
# - env: TOXENV=py36-nosubset-lm3
# name: "Python3.6 (Linux + lmoments3@master) (no subsetting)"
# python: 3.6
# - if: type = push
# env: TOXENV=py36-xarray
# name: "Python3.6 (Linux + xarray@master + cftime@master)"
Expand All @@ -59,87 +59,87 @@ jobs:
# env: TOXENV=py36-bottleneck
# name: "Python3.6 (Linux + bottleneck@master)"
# python: 3.6
- if: type = push
env: TOXENV=py38-anaconda
name: "Python3.8 (Linux + Anaconda)"
python: 3.8
before_install:
- printenv
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda install setuptools
- conda update -q conda
- conda create -n xclim -c conda-forge python=$TRAVIS_PYTHON_VERSION
- source activate xclim
- conda env update -f environment.yml
- conda install -c conda-forge pytest coveralls pytest-cov xdoctest
install:
- conda install pip
- pip install -e .[dev]
script:
- py.test --cov=xclim
- if: type = push
env:
- TOXENV=py37-windows
- DESIRED_PYTHON=3.7
- MINICONDA_PATH=$(cygpath --windows /c/miniconda)
name: "Python3.7 (Windows + Anaconda via Chocolatey)"
os: windows
language: shell
before_install:
- printenv
- choco install miniconda3 --params="'/AddToPath:0 /D:$MINICONDA_PATH'"
- source /c/miniconda/Scripts/activate
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda install setuptools
- conda update -q conda
- conda create -n xclim -c conda-forge python=$DESIRED_PYTHON
- source activate xclim
- sed -i -e 's/clisops>=0.4.0/clisops<0.4.0/g' environment.yml # clisops >0.4.0 not supported for Windows
- conda env update -f environment.yml
- conda install -c conda-forge pytest coveralls pytest-cov xdoctest
install:
- conda install pip
- pip install -e .[dev]
script:
- py.test --cov=xclim
allow_failures:
- env: TOXENV=py38-doctest
- env: TOXENV=py38-anaconda
# - if: type = push
# env: TOXENV=py38-anaconda
# name: "Python3.8 (Linux + Anaconda)"
# python: 3.8
# before_install:
# - printenv
# - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
# - bash miniconda.sh -b -p $HOME/miniconda
# - export PATH="$HOME/miniconda/bin:$PATH"
# - hash -r
# - conda config --set always_yes yes --set changeps1 no
# - conda install setuptools
# - conda update -q conda
# - conda create -n xclim -c conda-forge python=$TRAVIS_PYTHON_VERSION
# - source activate xclim
# - conda env update -f environment.yml
# - conda install -c conda-forge pytest coveralls pytest-cov xdoctest
# install:
# - conda install pip
# - pip install -e .[dev]
# script:
# - py.test --cov=xclim
# - if: type = push
# env:
# - TOXENV=py37-windows
# - DESIRED_PYTHON=3.7
# - MINICONDA_PATH=$(cygpath --windows /c/miniconda)
# name: "Python3.7 (Windows + Anaconda via Chocolatey)"
# os: windows
# language: shell
# before_install:
# - printenv
# - choco install miniconda3 --params="'/AddToPath:0 /D:$MINICONDA_PATH'"
# - source /c/miniconda/Scripts/activate
# - hash -r
# - conda config --set always_yes yes --set changeps1 no
# - conda install setuptools
# - conda update -q conda
# - conda create -n xclim -c conda-forge python=$DESIRED_PYTHON
# - source activate xclim
# - sed -i -e 's/clisops>=0.4.0/clisops<0.4.0/g' environment.yml # clisops >0.4.0 not supported for Windows
# - conda env update -f environment.yml
# - conda install -c conda-forge pytest coveralls pytest-cov xdoctest
# install:
# - conda install pip
# - pip install -e .[dev]
# script:
# - py.test --cov=xclim
# allow_failures:
# - env: TOXENV=py38-doctest
# - env: TOXENV=py38-anaconda
# - env: TOXENV=macOS
- env:
- TOXENV=py37-windows
- DESIRED_PYTHON=3.7
- MINICONDA_PATH=$(cygpath --windows /c/miniconda)
# - env:
# - TOXENV=py37-windows
# - DESIRED_PYTHON=3.7
# - MINICONDA_PATH=$(cygpath --windows /c/miniconda)
# - env: TOXENV=py36-xarray
# - env: TOXENV=py36-bottleneck

before_install:
- printenv
- pip install --upgrade pip setuptools

install:
- pip install -U tox-travis

script: tox -e $TOXENV

before_deploy:
- echo "$TRAVIS_TAG" "$TRAVIS_COMMIT"

deploy:
skip_existing: true
provider: pypi
distributions: sdist bdist_wheel
username: Zeitsperre
password:
secure: Fk0EFrbBumFHXWoCdTCdrsTp9lSnrksqhEbsXLYFhmfnsFtzQ9z4Uhs4sgyzNeA0VsIJ3q2RnPaSrgDXxDzguzSrm9R2tKjgSoZxrdaMKOaHwkJjkF+5DKqBUpjhGQmlLVt0u31vGBS3u8OE18cP4CxZOuPM2Dx2dnHLB9mVZAC8dlt5SBxS2HtC8J8IYilR/v4fkTt6niZPnaozsViBCiybnzyrylJsYeVhTj7p1buscw/yogZPylNV+O1Dn8GLXe7Viw3ZO5kIyEq96NMTBwpXtbgQmUClcGB6m1J+mx6wE0nh9abo69EtGOuaiCY9XqEgO7J8zZNIG2hC3Smy3+o96ltPopl3C2ZJebvM3aVqNx+GHnSkmAYw/VYtGb9Psd5IzafixTIQkBP6Qab8GGj2+iaeriLgTFqUEvxtywZZovQKHtXgPyy1kcztGSY/hygObQu4Ixvx8BjkzATfMKKkc3B8MBOeFnsxm7gn5IAhukbIh8JHTU4t2sHHJUVAbor3p7luGkZUp6ygoOuYsKNpER+cr39GLVV5p+IAY2Lm69aKSXkJe0tvPRouii2TNfnNU+S8ygbZ/6fqK5VTS1eLG0ehXXCxSDBkqt4xw4IFsoDFwObsjVSzKzcOP0UAqDWZhiHoiPLDxUfW/nA2JoTHrM3tBiXzWAZenS5y7Pc=
on:
tags: true
all_branches: true
condition: $TRAVIS_TAG =~ ^v[0-9]+\.[0-9]+[\.]?[a-c-]?[0-9]?[\w-]+\b
repo: Ouranosinc/xclim
python: 3.7
#
#before_install:
# - printenv
# - pip install --upgrade pip setuptools
#
#install:
# - pip install -U tox-travis
#
#script: tox -e $TOXENV
#
#before_deploy:
# - echo "$TRAVIS_TAG" "$TRAVIS_COMMIT"
#
#deploy:
# skip_existing: true
# provider: pypi
# distributions: sdist bdist_wheel
# username: Zeitsperre
# password:
# secure: Fk0EFrbBumFHXWoCdTCdrsTp9lSnrksqhEbsXLYFhmfnsFtzQ9z4Uhs4sgyzNeA0VsIJ3q2RnPaSrgDXxDzguzSrm9R2tKjgSoZxrdaMKOaHwkJjkF+5DKqBUpjhGQmlLVt0u31vGBS3u8OE18cP4CxZOuPM2Dx2dnHLB9mVZAC8dlt5SBxS2HtC8J8IYilR/v4fkTt6niZPnaozsViBCiybnzyrylJsYeVhTj7p1buscw/yogZPylNV+O1Dn8GLXe7Viw3ZO5kIyEq96NMTBwpXtbgQmUClcGB6m1J+mx6wE0nh9abo69EtGOuaiCY9XqEgO7J8zZNIG2hC3Smy3+o96ltPopl3C2ZJebvM3aVqNx+GHnSkmAYw/VYtGb9Psd5IzafixTIQkBP6Qab8GGj2+iaeriLgTFqUEvxtywZZovQKHtXgPyy1kcztGSY/hygObQu4Ixvx8BjkzATfMKKkc3B8MBOeFnsxm7gn5IAhukbIh8JHTU4t2sHHJUVAbor3p7luGkZUp6ygoOuYsKNpER+cr39GLVV5p+IAY2Lm69aKSXkJe0tvPRouii2TNfnNU+S8ygbZ/6fqK5VTS1eLG0ehXXCxSDBkqt4xw4IFsoDFwObsjVSzKzcOP0UAqDWZhiHoiPLDxUfW/nA2JoTHrM3tBiXzWAZenS5y7Pc=
# on:
# tags: true
# all_branches: true
# condition: $TRAVIS_TAG =~ ^v[0-9]+\.[0-9]+[\.]?[a-c-]?[0-9]?[\w-]+\b
# repo: Ouranosinc/xclim
# python: 3.7
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Internal changes
* modified `xclim.core.calendar.percentile_doy` to improve performance
* new `xclim.core.calendar.compare_offsets` for comparing offset strings
* new `xclim.indices.generic.get_op` to retrieve a function from a string representation of that operator.
* The CI pipeline has been migrated from Travis CI to GitHub Actions. All stages are still built using `tox`.


0.23.0 (2021-01-22)
Expand Down
5 changes: 2 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypack
:target: https://gitter.im/Ouranosinc/xclim?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge
:alt: Gitter Chat


.. |build| image:: https://img.shields.io/travis/Ouranosinc/xclim.svg
:target: https://travis-ci.com/Ouranosinc/xclim
.. |build| image:: https://github.com/Ouranosinc/xclim/workflows/xclim/badge.svg
:target: https://github.com/Ouranosinc/xclim/actions
:alt: Build Status

.. |coveralls| image:: https://coveralls.io/repos/github/Ouranosinc/xclim/badge.svg
Expand Down
3 changes: 2 additions & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ tox
coverage
twine
pytest
pytest-cov
pytest-runner
pylint
xdoctest
pydocstyle
pydocstyle>=5.1.1
nbval
pre-commit>=2.9
Loading

0 comments on commit 2544dde

Please sign in to comment.