Add linting and type checks #52
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: | |
pull_request: | |
push: | |
branches: ["main"] | |
jobs: | |
build-and-test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ['3.10', '3.11'] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest | |
- name: Build and install TopoToolbox | |
run: | | |
pip install .[opensimplex] | |
- name: Run tests | |
run: | | |
python -m pytest | |
lint: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
- name: Install tools | |
run: | | |
pip install mypy | |
pip install pylint | |
pip install numpy | |
pip install matplotlib | |
pip install rasterio | |
- name: Run flake8 | |
run: flake8 src/topotoolbox | |
#- name: Run pylint | |
# run: pylint src/topotoolbox/ | |
- name: Run type checks | |
run: mypy --follow-imports=skip --ignore-missing-imports src/topotoolbox |