Merge pull request #242 from ArtesiaWater/calculate_sea #637
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
name: nlmod | |
on: | |
# Trigger the workflow on push or pull request on main, | |
# and only on pull-requests on dev branch | |
push: | |
branches: | |
- main | |
- dev | |
pull_request: | |
branches: | |
- main | |
- dev | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.9] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e .[ci] | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=80 --statistics | |
- name: Download executables needed for tests | |
shell: bash -l {0} | |
run: | | |
python -c "import nlmod; nlmod.util.download_mfbinaries()" | |
- name: Run notebooks | |
if: ${{ github.event_name == 'push' }} | |
run: | | |
py.test ./tests -m "not notebooks" | |
- name: Run tests only | |
if: ${{ github.event_name == 'pull_request' }} | |
run: | | |
py.test ./tests -m "not notebooks" | |
- name: Run codacy-coverage-reporter | |
uses: codacy/codacy-coverage-reporter-action@master | |
with: | |
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
coverage-reports: coverage.xml |