Skip to content

Commit

Permalink
tests: use GitHub Actions for CI (landlab#1270)
Browse files Browse the repository at this point in the history
* add github actions for ci

* remove appveyor config file

* add pyproject.toml

* fix syntax error

* reformat with black

* only run black on source dirs

* remove binnedlayers.py from version control

* remove setup_requires

* run black on everything

* remove old .ci folder

* install requirements as a separate step

* reformat files in docs, notebooks with black

* reformat versioneer.py with black

* install build-system explicitly

* install dependencies with conda

* add numpy as a requirement

* install a c compiler

* always build docs, for now

* fix syntax error

* install requirements with mamba

* drop python 3.9 builds

* install docs requirements with pip

* install landlab in editable mode

* fix pip install command

* remove linkcheck when building docs

* use shapeTypeName instead of shapeType

* remove notebook tests from testing step

* set shapeType, not shapeTypeName

* pop dbf keyword it is None

* add new badges, remove old ones

* remove unused import

* add github action for testing the notebooks

* update action names

* create temp notebook script in current directory

* fix for windows--use unique filename not tempfile

* remove stray notebook
  • Loading branch information
mcflugen authored Feb 17, 2021
1 parent af92439 commit f8988b5
Show file tree
Hide file tree
Showing 62 changed files with 1,095 additions and 771 deletions.
27 changes: 0 additions & 27 deletions .ci/appveyor/pypi_upload.py

This file was deleted.

36 changes: 0 additions & 36 deletions .ci/appveyor/run_with_env.cmd

This file was deleted.

20 changes: 0 additions & 20 deletions .ci/travis/build_wheels.sh

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Black

on: [push, pull_request]

jobs:

lint:
# We want to run on external PRs, but not on our own internal PRs as they'll be run
# by the push to the branch. Without this if check, checks are duplicated since
# internal PRs match both the push and pull_request events.
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
github.repository

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: psf/black@stable
with:
black_args: ". --check"
59 changes: 59 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Documentation

on: [push, pull_request]
# on:
# push:
# paths:
# - "docs/**"
# - "AUTHORS.rst"
# - "CHANGES.rst"
# - "CONTRIBUTING.rst"
# - "LICENSE.rst"
# - "README.rst"
# pull_request:
# paths:
# - "docs/**"
# - "AUTHORS.rst"
# - "CHANGES.rst"
# - "CONTRIBUTING.rst"
# - "LICENSE.rst"
# - "README.rst"

jobs:
build:
# We want to run on external PRs, but not on our own internal PRs as they'll be run
# by the push to the branch. Without this if check, checks are duplicated since
# internal PRs match both the push and pull_request events.
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
github.repository

runs-on: ubuntu-latest

defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: 3.8
channels: conda-forge
channel-priority: true

- name: Show conda installation info
run: |
conda info
conda list
- name: Install dependencies
run: |
conda install mamba
mamba install --file=requirements.txt
pip install -r requirements-docs.txt
pip install -e .
- name: Build documentation
run: make -C docs clean html
26 changes: 26 additions & 0 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Flake8

on: [push, pull_request]

jobs:

lint:
# We want to run on external PRs, but not on our own internal PRs as they'll be run
# by the push to the branch. Without this if check, checks are duplicated since
# internal PRs match both the push and pull_request events.
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
github.repository

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Lint
run: |
pip install flake8
flake8 landlab tests
57 changes: 57 additions & 0 deletions .github/workflows/test-notebooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Notebooks

on: [push, pull_request]

jobs:
build-and-test:
# We want to run on external PRs, but not on our own internal PRs as they'll be run
# by the push to the branch. Without this if check, checks are duplicated since
# internal PRs match both the push and pull_request events.
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
github.repository

runs-on: ${{ matrix.os }}

defaults:
run:
shell: bash -l {0}

strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2

- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge
channel-priority: true

- name: Show conda installation info
run: |
conda info
conda list
- name: Install requirements
run: |
conda install mamba
mamba install --file=requirements.txt
mamba list
- name: Build and install package
run: |
pip install -e .
- name: Install testing dependencies
run: mamba install --file=requirements-testing.txt -c conda-forge

- name: Test jupyter notebooks
run: |
python -c 'import landlab; print(landlab.__version__)'
pip install -r requirements-notebooks.txt
pytest notebooks --run-notebook -vvv
60 changes: 60 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
ssame: Test

on: [push, pull_request]

jobs:
build-and-test:
# We want to run on external PRs, but not on our own internal PRs as they'll be run
# by the push to the branch. Without this if check, checks are duplicated since
# internal PRs match both the push and pull_request events.
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
github.repository

runs-on: ${{ matrix.os }}

defaults:
run:
shell: bash -l {0}

strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2

- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge
channel-priority: true

- name: Show conda installation info
run: |
conda info
conda list
- name: Install requirements
run: |
conda install mamba
mamba install --file=requirements.txt
mamba list
- name: Build and install package
run: |
pip install -e .
- name: Install testing dependencies
run: mamba install --file=requirements-testing.txt

- name: Test
run: |
python -c 'import landlab; print(landlab.__version__)'
pytest --cov=landlab --cov-report=xml:$(pwd)/coverage.xml -vvv
- name: Coveralls
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9'
uses: AndreMiras/coveralls-python-action@v20201129
12 changes: 7 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
.. image:: https://readthedocs.org/projects/landlab/badge/?version=latest
:target: https://readthedocs.org/projects/landlab/?badge=latest

.. image:: https://travis-ci.org/landlab/landlab.svg?branch=master
:target: https://travis-ci.org/landlab/landlab
.. image:: https://github.com/landlab/landlab/workflows/Build/Test%20CI/badge.svg

.. image:: https://github.com/landlab/landlab/workflows/Flake8/badge.svg

.. image:: https://github.com/landlab/landlab/workflows/Black/badge.svg

.. image:: https://github.com/landlab/landlab/workflows/Documentation/badge.svg

.. image:: https://coveralls.io/repos/landlab/landlab/badge.png
:target: https://coveralls.io/r/landlab/landlab

.. image:: https://ci.appveyor.com/api/projects/status/6u0bj0pggxrmf7s1/branch/master?svg=true
:target: https://ci.appveyor.com/project/mcflugen/landlab/branch/master

.. image:: https://landscape.io/github/landlab/landlab/master/landscape.svg
:target: https://landscape.io/github/landlab/landlab/master

Expand Down
58 changes: 0 additions & 58 deletions appveyor.yml

This file was deleted.

Loading

0 comments on commit f8988b5

Please sign in to comment.