Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(linting): Initial GitHub actions for linting #954

Merged
merged 53 commits into from
Aug 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
7f68ddd
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
999f2a9
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
c198e1e
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
cacdf74
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
0bd6dad
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
09e3e01
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
0227141
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
5b8d711
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
d98f922
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
c7fb375
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
6404023
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
204792a
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
253d288
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
9f08a8b
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
d1accfe
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
94c7c0a
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
7bf44e8
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
85820ab
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
7fefa30
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
7b66550
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
691b57c
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
d4a8c46
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
2e35fb5
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
66903f1
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
61a55df
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
840e49a
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 3, 2020
3bc9b45
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 4, 2020
3b1259a
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 4, 2020
cbf9e6a
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 4, 2020
e2ec9c5
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 4, 2020
bdfa659
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 4, 2020
20b39e6
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 4, 2020
2468e3d
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 4, 2020
64f96f9
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 4, 2020
c41f38f
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 4, 2020
f21799f
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 4, 2020
a9113f3
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 4, 2020
d11f16d
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 4, 2020
d7a68be
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 4, 2020
0ade989
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 4, 2020
9e01934
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 4, 2020
e5bfb9c
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 4, 2020
492a74f
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 5, 2020
042da8c
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 5, 2020
7f2061b
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 5, 2020
c91f59d
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 5, 2020
9db3ba3
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 5, 2020
56ab751
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 5, 2020
7b7c302
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 5, 2020
f6f3c2b
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 5, 2020
bc55ede
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 5, 2020
6291ed0
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 5, 2020
59634ca
ci(linting): Initial GitHub actions for linting
jdhughes-usgs Aug 5, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ignore =
E126, # continuation line over-indented for hanging indent
E127, # continuation line over-indented for visual indent
E128, # continuation line under-indented for visual indent
E203, # whitespace before
E221, # multiple spaces before operator
E222, # multiple spaces after operator
E226, # missing whitespace around arithmetic operator
Expand All @@ -24,10 +25,13 @@ ignore =
E501, # line too long (> 79 characters)
E502, # backslash is redundant between brackets
E722, # do not use bare 'except'
E741, # ambiguous variable name
W291, # trailing whitespace
W292, # no newline at end of file
W293, # blank line contains whitespace
W391, # blank line at end of file
W503, # line break before binary operator
W504 # line break after binary operator
W504, # line break after binary operator
W605 # invalid escape sequence

statistics = True
189 changes: 189 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
name: flopy continuous integration

on:
push:
pull_request:

jobs:

flopy_lint:
name: linting
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:

# check out repo
- name: Checkout flopy repo
uses: actions/checkout@v2

# Standard python fails on windows without GDAL installation. Using
# standard python here since only linting on linux.
# Use standard bash shell with standard python
- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Print python version
shell: bash
run: |
python --version

- name: Install Python 3.8 packages
shell: bash
run: |
python -m pip install --upgrade pip
pip install -r requirements.pip.txt

- name: Run black
shell: bash
run: |
echo "if black check fails run"
echo " black --line-length 79 ./flopy"
echo "and then commit the changes."
black --check --line-length 79 ./flopy

- name: Run flake8
shell: bash
run: |
flake8 --count --show-source --exit-zero ./flopy

- name: Run pylint
shell: bash
run: |
pylint --jobs=2 --errors-only --exit-zero ./flopy

flopyScriptNotebookCI:
name: additional tests
needs: flopy_lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test-file: [autotest_notebooks.py, autotest_scripts.py]
steps:
# check out repo
- name: Checkout flopy repo
uses: actions/checkout@v2

# Standard python fails on windows without GDAL installation
# Using custom bash shell ("shell: bash -l {0}") with Miniconda
- name: Setup Miniconda
uses: goanpeca/setup-miniconda@v1.6.0
with:
python-version: 3.8
activate-environment: flopy
auto-update-conda: true
environment-file: environment.yml

- name: Determine python environment
shell: bash -l {0}
run: |
conda info
conda list

- name: Install additional Python 3.8 packages
if: matrix.test-file == 'autotest_notebooks.py'
shell: bash -l {0}
run: |
conda install nbconvert jupyter

- name: Install xmipy, pymake, and flopy
shell: bash -l {0}
run: |
pip install xmipy
pip install .
pip install https://github.com/modflowpy/pymake/zipball/master

- name: Download executables needed for tests
shell: bash -l {0}
run: |
python ./autotest/get_exes.py

- name: Add executables directory to path
shell: bash
run: |
echo "::add-path::$HOME/.local/bin"

- name: Run ${{ matrix.test-file }} CI
shell: bash -l {0}
run: |
coverage run -m nose -v ${{ matrix.test-file }} --with-id --with-timer \
--with-coverage --cover-package=flopy --cover-xml \
--cover-xml-file=../coverage.xml -w ./autotest

- name: List files in the root directory
shell: bash
run: |
ls -l

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1.0.12
with:
file: ./coverage.xml

flopyCI:
name: autotests
needs: flopy_lint
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.7, 3.6]
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
# check out repo
- name: Checkout flopy repo
uses: actions/checkout@v2

# Standard python fails on windows without GDAL installation
# Using custom bash shell ("shell: bash -l {0}") with Miniconda
- name: Setup Miniconda
uses: goanpeca/setup-miniconda@v1.6.0
with:
python-version: ${{ matrix.python-version }}
activate-environment: flopy
auto-update-conda: true
environment-file: environment.yml

- name: Determine python environment
shell: bash -l {0}
run: |
conda info
conda list

- name: Install xmipy, pymake, and flopy
shell: bash -l {0}
run: |
pip install xmipy
pip install .
pip install https://github.com/modflowpy/pymake/zipball/master

- name: Download executables needed for tests
shell: bash -l {0}
run: |
python ./autotest/get_exes.py

- name: Add executables directory to path
shell: bash
run: |
echo "::add-path::$HOME/.local/bin"

- name: Run nosetests
shell: bash -l {0}
run: |
coverage run -m nose -v --with-id --with-timer \
--with-coverage --cover-package=flopy --cover-xml \
--cover-xml-file=../coverage.xml -w ./autotest

- name: List files in the root directory
shell: bash
run: |
ls -l

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1.0.12
with:
file: ./coverage.xml
Loading