Add support for django 5 #37
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: code | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
paths: | |
- pyproject.toml | |
- poetry.lock | |
- "**.py" | |
jobs: | |
django-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: ["3.10", "3.11", "3.12"] | |
django-version: ["~=5.0.0", "~=5.1.0"] | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: djsc_sandbox | |
ports: | |
- 5432:5432 | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/cache@v1 | |
with: | |
path: ~/.cache/pypoetry | |
key: py${{ matrix.python-version }}-poetry-${{ hashFiles('**/poetry.lock') }} | |
restore-keys: | | |
py-poetry- | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade poetry | |
python -m poetry install | |
- name: Install Django specific version ${{ matrix.django-version }} | |
run: | | |
python -m poetry run pip install "Django${{ matrix.django-version }}" | |
- name: Run Tests | |
run: | | |
python -m poetry run coverage run djsc_sandbox/manage.py test tests | |
python -m poetry run coverage lcov -o ./coverage/lcov.info | |
- name: Upload coverage to Coveralls in parallel | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
flag-name: run-py${{ matrix.python-version }}-Django${{ matrix.django-version }} | |
parallel: true | |
finish: | |
needs: django-tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Finish report to Coveralls | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
parallel-finished: true |