Skip to content

Commit

Permalink
CI: GitHub Actions (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
snowman2 authored Nov 11, 2020
1 parent 82426bd commit a73d311
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 31 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: '0 0 * * 0'

jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/[email protected]

test:
needs: linting
name: ${{ matrix.os }}, ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.6, 3.7, 3.8, 3.9]
include:
- os: windows-latest
python-version: 3.7
- os: windows-latest
python-version: 3.8

steps:
- uses: actions/checkout@v2

- name: Setup Conda
uses: s-weigand/setup-conda@v1
with:
activate-conda: false
python-version: ${{ matrix.python-version }}
conda-channels: conda-forge

- name: Install Env
shell: bash
run: |
conda create -n test python=${{ matrix.python-version }} rasterio xarray scipy pyproj netcdf4 dask pandoc
source activate test
python -m pip install -e .[all]
- name: Check and Log Environment
shell: bash
run: |
source activate test
python -V
python -c "import rioxarray; rioxarray.show_versions();"
conda info
- name: Test
shell: bash
run: |
source activate test
py.test --cov-report term-missing --cov=rioxarray --cov-report xml
- name: Test Build docs
shell: bash
if: contains(matrix.os, 'ubuntu')
run: |
source activate test
sphinx-build -b html docs/ docs/_build/
- uses: codecov/codecov-action@v1
33 changes: 4 additions & 29 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,19 @@
# System specifications for Travis CI
#-------------------------------------------------------------------------------
language: c
if: branch = master OR tag IS present
env:
global:
# Doctr deploy key for corteva/rioxarray
- secure: "CWWro84t7SpW3AuV6dE1d4Lcx3V7HZWi47RHovcKTxrcoD0iwu/cYXG3f0yiN81ehFmWOK/4mkCV8bEpF9THdwyoWQdKn0rF92IESy0+ZLdyDy0yvrL/nt2PY7oAL0OH0yuh784eTivhmUmBYjcZZdEDJnymM2Wgf1VgtKDhvqGgk+gzQkO4M4vc7/H7sERkmvH7AvsYhgP9zD2yelwOYfFuNa7n7RkHwymABWwDGXN3ri0wXkRJst3CSccv2BstzVl9K5OHevTdPqyATK5a9D5J8szf4X2oem/bisJsT5w+SyX9tmWJJbItEUsDghcWM3wQqWfguXl5cYQ7Bf7P2LbrphD4Hr5lmOpG9M/mijyL+2nkCoK7woXU4z02TZEX8mO43RmaHIWYOVBi4HRDIpj5Y6MgktctfGk8lg67V5eRjZwG4Jj1mhn+lnCpu2pK5pH0pTmWEM8QFcjF7DadMif38x0KcG74ukExxOX3lXGeN+mZN/eD7z1J3pfTi6U/acXDBtVG2li2YI5dMkEwad/IE8Q5s+TGH1AVFGBPMQWY2VEtRuSTKWZtK/09VEJcbP8CzhDu2I7ZOEvMcNqwUX/aZrNBgbZfZZijkIcC0ToJMfZs1Tg8gl6n+OTEnAuWf/727F8oTNYv0oR/MHCBPdrbQHsXRlZ8b4HZcG+3wNA="
matrix:
fast_finish: true
include:
- os: osx
env:
- PYTHON_VERSION=3.6
- os: osx
env:
- PYTHON_VERSION=3.7
- os: osx
env:
- PYTHON_VERSION=3.8
- os: osx
env:
- PYTHON_VERSION=3.9
- os: linux
env:
- PYTHON_VERSION=3.6
- os: linux
env:
- PYTHON_VERSION=3.7
- DOC=true
- os: linux
env:
- PYTHON_VERSION=3.8
- os: linux
env:
- PYTHON_VERSION=3.9
- DOC=true

notifications:
email: false

Expand All @@ -59,11 +41,8 @@ before_install:

install:
- pip install .[all]
- pip install coveralls

script:
- py.test --cov-report term-missing --cov=rioxarray
- make check
- make docs
# Building and uploading docs with doctr
- set -e
Expand All @@ -77,7 +56,3 @@ script:
fi
doctr deploy --build-tags --built-docs docs/_build/html $DEPLOY_DIR
fi
after_success:
# Coveralls stats for code coverage
- coveralls
7 changes: 5 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@ rasterio xarray extension.
.. image:: https://img.shields.io/conda/vn/conda-forge/rioxarray.svg
:target: https://anaconda.org/conda-forge/rioxarray

.. image:: https://github.com/corteva/rioxarray/workflows/Tests/badge.svg
:target: https://github.com/corteva/rioxarray/actions?query=workflow%3ATests

.. image:: https://travis-ci.com/corteva/rioxarray.svg?branch=master
:target: https://travis-ci.com/corteva/rioxarray

.. image:: https://ci.appveyor.com/api/projects/status/e6sr22mkpen261c1/branch/master?svg=true
:target: https://ci.appveyor.com/project/snowman2/rioxarray

.. image:: https://coveralls.io/repos/github/corteva/rioxarray/badge.svg?branch=master
:target: https://coveralls.io/github/corteva/rioxarray?branch=master
.. image:: https://codecov.io/gh/corteva/rioxarray/branch/master/graph/badge.svg
:target: https://codecov.io/gh/corteva/rioxarray

.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white
:target: https://github.com/pre-commit/pre-commit
Expand Down
6 changes: 6 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
coverage:
status:
project:
default:
target: 90% # the required coverage value
threshold: 0.2% # the leniency in hitting the target

0 comments on commit a73d311

Please sign in to comment.