add mypy to ci (but ignore for now), add numpy typing plugin #78
Workflow file for this run
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: CI | ||
on: | ||
push: | ||
paths-ignore: | ||
- '**.md' | ||
- '.gitignore' | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
paths-ignore: | ||
- '**.md' | ||
- '.gitignore' | ||
jobs: | ||
check: | ||
name: Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.9 | ||
cache: 'pip' | ||
cache-dependency-path: pyproject.toml | ||
- name: Install Python packages | ||
run: pip install ".[lint]" | ||
- name: Linter | ||
run: ruff check . | ||
- name: Formatter | ||
run: ruff format --check | ||
# TODO: enable when passing | ||
# - name: Type checker | ||
# run: mypy flopy4 | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.9 | ||
- name: Install Python packages | ||
run: | | ||
pip install --upgrade pip | ||
pip install build twine | ||
pip --verbose install . | ||
- name: Print package version | ||
run: python -c "from flopy4 import version; print(version.__version__)" | ||
- name: Build package | ||
run: python -m build | ||
test: | ||
name: Test | ||
needs: | ||
- build | ||
- lint | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu-22.04, macos-12, windows-2022 ] | ||
python: [ 3.9, "3.10", "3.11", "3.12" ] | ||
env: | ||
GCC_V: 11 | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
- name: Install nightly build | ||
uses: modflowpy/install-modflow-action@v1 | ||
with: | ||
repo: modflow6-nightly-build | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Install Python packages | ||
run: pip install ".[test]" | ||
- name: Run tests | ||
run: pytest -v -n auto |