chore: update all versions (incl Django 5/Python 3.13) and make Docker config sensible #689
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: Python Tests | |
on: | |
workflow_call: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
run-tests: | |
name: Django Tests | |
runs-on: ubuntu-latest | |
env: | |
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/postgres" | |
PYTHONPATH: "${{ github.workspace }}:${{ github.workspace }}/app" | |
DJANGO_SETTINGS_MODULE: "conf.settings.development" | |
REDIS_URL: "redis://localhost:6379" | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Install GeoDjango dependencies | |
run: sudo apt-get install gdal-bin libgdal-dev libgeos-dev libproj-dev -y | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
enable-cache: true | |
version: "latest" | |
- name: Install dependencies | |
run: uv sync --frozen | |
- name: Run Django tests | |
working-directory: ${{ github.workspace }}/app | |
run: | | |
uv run coverage run manage.py test -v 2 --no-input | |
uv run coverage xml | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ${{ github.workspace }}/app/coverage.xml | |
services: | |
postgres: | |
image: postgis/postgis:17-3.5 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: postgres | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
redis: | |
image: redis:7.4 | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 6379:6379 |