Allow range of known versions for dependencies (#460) #1039
This file contains hidden or 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: Tests | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| tests: | |
| name: Test code | |
| runs-on: ubuntu-latest | |
| env: | |
| UV_PYTHON: ${{ matrix.python }} | |
| strategy: | |
| matrix: | |
| python: | |
| - "3.11" # Debian Bookworm | |
| - "3.13" # Debian Trixie | |
| services: | |
| db: | |
| image: 'postgres:17' | |
| env: | |
| POSTGRES_USER: serveradmin | |
| POSTGRES_PASSWORD: serveradmin | |
| POSTGRES_DB: serveradmin | |
| ports: | |
| - 5432/tcp | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Prepare | |
| run: | | |
| uv sync | |
| echo "DATABASES = { | |
| 'default': { | |
| 'ENGINE': 'django.db.backends.postgresql', | |
| 'HOST': '127.0.0.1', | |
| 'PORT': '${{ job.services.db.ports[5432] }}', | |
| 'NAME': 'serveradmin', | |
| 'USER': 'serveradmin', | |
| 'PASSWORD': 'serveradmin', | |
| 'OPTIONS': { | |
| 'connect_timeout': 1, | |
| 'client_encoding': 'UTF8', | |
| }, | |
| }, | |
| } | |
| SECRET_KEY = 'TEST' | |
| TIME_ZONE = 'Europe/Berlin' | |
| LOGGING = {}" > packages/serveradmin/serveradmin/local_settings.py | |
| cat packages/serveradmin/serveradmin/local_settings.py | |
| uv run python -m serveradmin migrate | |
| - name: Tests | |
| run: | | |
| # This will use Python's standard unit test discovery feature. | |
| uv run python -m unittest discover -t packages/adminapi -s packages/adminapi/adminapi -v | |
| uv run python -Wall -m serveradmin test serveradmin --noinput --parallel=10 | |
| # Build sphinx docs, error on warning | |
| cd docs | |
| SPHINXBUILD='uv run --group docs sphinx-build' SPHINXOPTS='-W' make html |