Skip to content

[pre-commit.ci] pre-commit autoupdate #321

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #321

Workflow file for this run

---
name: Tests
# yamllint disable-line rule:truthy
on:
push:
branches:
- main
- v*
pull_request:
branches:
- main
- v*
release:
types:
- released
jobs:
typing:
name: Typing
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5
with:
cache: poetry
- name: Install Deps
run: poetry install
- run: echo "$(poetry env info --path)/bin" >> $"GITHUB_PATH"
- id: venv
run: echo "python-path=$(poetry env info --path)/bin/python3" >> "$GITHUB_OUTPUT"
- name: Check for pyright errors
uses: jakebailey/pyright-action@v1
with:
python-path: ${{ steps.venv.outputs.python-path }}
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
django-version:
- 4.2.*
- 5.0.*
python-version:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.12'
mode:
- std
- geos
exclude:
# Django 5.0 only supports python 3.10+
- django-version: 5.0.*
python-version: '3.8'
- django-version: 5.0.*
python-version: '3.9'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install OS Dependencies
if: ${{ matrix.mode == 'geos' }}
uses: daaku/gh-action-apt-install@v4
with:
packages: binutils gdal-bin libproj-dev libsqlite3-mod-spatialite
- name: Install Poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v5
with:
cache: poetry
python-version: ${{ matrix.python-version }}
- name: Install Deps
run: poetry install
- name: Install Django ${{ matrix.django-version }}
run: poetry run pip install "django==${{ matrix.django-version }}"
- name: Test with pytest
run: poetry run pytest --showlocals -vvv --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}