Skip to content

Commit

Permalink
Merge pull request #149 from boutproject/ci-tests-to-github-actions
Browse files Browse the repository at this point in the history
Convert CI to Google action instead of Travis
  • Loading branch information
johnomotani authored Oct 2, 2020
2 parents f9614a5 + 367b6ac commit 4b4fc97
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 36 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/black.yml

This file was deleted.

79 changes: 79 additions & 0 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
[push, pull_request]

jobs:
pytest:

runs-on: ubuntu-latest
if: always()
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
pip-packages:
- "setuptools pip pytest pytest-cov coverage codecov boutdata xarray!=0.14.0 numpy>=1.16.0"
- "setuptools pip pytest pytest-cov coverage codecov boutdata xarray==0.16.0 dask==2.10.0 numpy==1.16.0 natsort==5.5.0 matplotlib==3.1.1 animatplot==0.4.1 netcdf4==1.4.2 Pillow==6.1.0 fsspec" # test with oldest supported version of packages. Note, using numpy==1.16.0 as a workaround for some weird fails on Travis, in principle we should work with numpy>=1.13.3. We should not need to install fsspec explicitly, but at the moment are getting import errors in the tests due to fsspec not being present - should remove in future, probably when dask version is increased.
fail-fast: false

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get install libhdf5-dev libnetcdf-dev
python -m pip install --upgrade pip
pip install --upgrade ${{ matrix.pip-packages }}
pip install -r requirements.txt
- name: Test with pytest
run: |
pip install pytest
pytest -v --long --cov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true


# Need to tidy up the things that flake8 finds before we activate this
#flake8:

# runs-on: ubuntu-latest
# if: always()

# steps:
# - uses: actions/checkout@v2
# - name: Set up Python
# uses: actions/setup-python@v1
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -r requirements.txt
# - name: Lint with flake8
# run: |
# pip install flake8
# flake8


black:

runs-on: ubuntu-latest
if: always()

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Check formatting with black
run: |
pip install black
black --check .
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

0 comments on commit 4b4fc97

Please sign in to comment.