-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #149 from boutproject/ci-tests-to-github-actions
Convert CI to Google action instead of Travis
- Loading branch information
Showing
3 changed files
with
79 additions
and
36 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 . |
This file was deleted.
Oops, something went wrong.