Skip to content

Commit

Permalink
Merge pull request #125 from adybbroe/add-github-ci-support
Browse files Browse the repository at this point in the history
Add GitHub ci support
  • Loading branch information
adybbroe committed Dec 6, 2020
2 parents 671cc9c + 37a50ca commit 442e9c4
Show file tree
Hide file tree
Showing 5 changed files with 162 additions and 16 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/ci.yaml
@@ -0,0 +1,76 @@
name: CI

on: [push, pull_request]

jobs:
test:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: true
matrix:
os: ["windows-latest", "ubuntu-latest", "macos-latest"]
python-version: ["3.7", "3.8"]
experimental: [false]
include:
- python-version: "3.8"
os: "ubuntu-latest"
experimental: true

env:
PYTHON_VERSION: ${{ matrix.python-version }}
OS: ${{ matrix.os }}
UNSTABLE: ${{ matrix.experimental }}
ACTIONS_ALLOW_UNSECURE_COMMANDS: true

steps:
- name: Checkout source
uses: actions/checkout@v2

- name: Setup Conda Environment
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
python-version: ${{ matrix.python-version }}
mamba-version: "*"
channels: conda-forge,defaults
environment-file: continuous_integration/environment.yaml
activate-environment: test-environment

- name: Install unstable dependencies
if: matrix.experimental == true
shell: bash -l {0}
run: |
python -m pip install \
-f https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com \
--no-deps --pre --upgrade \
matplotlib \
numpy \
pandas \
scipy; \
python -m pip install \
--no-deps --upgrade \
git+https://github.com/dask/dask \
git+https://github.com/dask/distributed \
git+https://github.com/zarr-developers/zarr \
git+https://github.com/Unidata/cftime \
git+https://github.com/mapbox/rasterio \
git+https://github.com/pydata/bottleneck \
git+https://github.com/pydata/xarray;
- name: Install Pyspectral
shell: bash -l {0}
run: |
pip install --no-deps -e .
- name: Run unit tests
shell: bash -l {0}
run: |
pytest --cov=pyspectral pyspectral/tests --cov-report=xml
- name: Upload unittest coverage to Codecov
uses: codecov/codecov-action@v1
with:
flags: unittests
file: ./coverage.xml
env_vars: OS,PYTHON_VERSION,UNSTABLE
25 changes: 25 additions & 0 deletions .github/workflows/deploy-sdist.yaml
@@ -0,0 +1,25 @@
name: Deploy sdist

on:
release:
types:
- published

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout source
uses: actions/checkout@v2

- name: Create sdist
shell: bash -l {0}
run: python setup.py sdist

- name: Publish package to PyPI
if: github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@v1.4.1
with:
user: __token__
password: ${{ secrets.pypi_password }}
30 changes: 15 additions & 15 deletions .travis.yml
Expand Up @@ -32,18 +32,18 @@ install:
- pip install -e .
script:
- py.test --cov-report term --cov=./
after_success:
- if [[ $PYTHON_VERSION == 3.7 ]]; then coveralls; fi
- if [[ $PYTHON_VERSION == 3.8 ]]; then coveralls; fi
deploy:
- provider: pypi
user: adybbroe
password:
secure: SY0qo7sZXDjDx0DHvuXrHvL9VTAulgU/T33d6UWXf469jT9DOexuZ2VYLgJbYQen5FSe5JmQE0ZMdId1cb8IPP/77qCgQK6f0lRDa43fSYXhcD+fHzlQskievJrwamkRYx6WBrJbwGAKBNinUgNSaTdbh9XUugziGFiOHUfVppM=
distributions: sdist bdist_wheel
skip_existing: true
on:
tags: true
repo: pytroll/pyspectral
notifications:
slack: pytroll:LR63XVq1cT8kVc3fnXKIZmYr
# after_success:
# - if [[ $PYTHON_VERSION == 3.7 ]]; then coveralls; fi
# - if [[ $PYTHON_VERSION == 3.8 ]]; then coveralls; fi
# deploy:
# - provider: pypi
# user: adybbroe
# password:
# secure: SY0qo7sZXDjDx0DHvuXrHvL9VTAulgU/T33d6UWXf469jT9DOexuZ2VYLgJbYQen5FSe5JmQE0ZMdId1cb8IPP/77qCgQK6f0lRDa43fSYXhcD+fHzlQskievJrwamkRYx6WBrJbwGAKBNinUgNSaTdbh9XUugziGFiOHUfVppM=
# distributions: sdist bdist_wheel
# skip_existing: true
# on:
# tags: true
# repo: pytroll/pyspectral
#notifications:
# slack: pytroll:LR63XVq1cT8kVc3fnXKIZmYr
4 changes: 3 additions & 1 deletion README.md
@@ -1,7 +1,9 @@
Pyspectral
==========

[![Build Status](https://travis-ci.org/pytroll/pyspectral.png?branch=master)](https://travis-ci.org/pytroll/pyspectral)

[![Build status](https://github.com/pytroll/pyspectral/actions?query=workflow%3A%22CI%22)](https://github.com/pytroll/pyspectral/workflows/CI/badge.svg?branch=master)
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/pyspectral/badges/version.svg)](https://anaconda.org/conda-forge/pyspectral)
[![Build status](https://ci.appveyor.com/api/projects/status/5lm42n0l65l5o9xn?svg=true)](https://ci.appveyor.com/project/pytroll/pyspectral)
[![Coverage Status](https://coveralls.io/repos/github/pytroll/pyspectral/badge.svg?branch=master)](https://coveralls.io/github/pytroll/pyspectral?branch=master)
[![PyPI version](https://badge.fury.io/py/pyspectral.svg)](https://badge.fury.io/py/pyspectral)
Expand Down
43 changes: 43 additions & 0 deletions continuous_integration/environment.yaml
@@ -0,0 +1,43 @@
name: test-environment
channels:
- conda-forge
dependencies:
- xarray
- dask
- distributed
- toolz
- Cython
- sphinx
- cartopy
- pillow
- matplotlib
- scipy
- pyyaml
- pyproj
- pyresample
- coveralls
- coverage
- codecov
- behave
- netcdf4
- h5py
- h5netcdf
- imageio
- pyhdf
- mock
- libtiff
- geoviews
- zarr
- python-eccodes
- geoviews
- pytest
- pytest-cov
- fsspec
- pylibtiff
- appdirs
- python-geotiepoints
- pip
- pip:
- trollsift
- trollimage
- pyorbital

0 comments on commit 442e9c4

Please sign in to comment.