Skip to content

chore:update

chore:update #677

Workflow file for this run

name: Django CI
on:
pull_request:
branches:
- master
push:
branches:
- master
workflow_dispatch:
jobs:
ruff:
runs-on: ubuntu-latest
name: "ruff on code"
permissions:
contents: read
steps:
- uses: actions/checkou2222t@v4
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@v3
- uses: actions/setup-python@v5
with:
cache-dependency-path: uv.lock
python-version: "3.13"
- name: Run ruff
shell: bash
run: |
uv run ruff check
test-regular:
needs: ["ruff"]
runs-on: ubuntu-latest
name: "Tests py${{ matrix.python-version }}/dj${{ matrix.django-version }}/${{ matrix.broker }}"
strategy:
max-parallel: 6
matrix:
python-version: ["3.11", "3.12", "3.13"]
django-version: ["5.2.5"]
broker: ["redis", "fakeredis", "valkey"]
include:
- python-version: "3.13"
django-version: "5.2.5"
broker: "redis"
coverage: yes
permissions:
pull-requests: write
services:
redis:
image: redis:8.0.0
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
valkey:
image: valkey/valkey:8.0
ports:
- 6380:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
outputs:
version: ${{ steps.getVersion.outputs.VERSION }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@v6
- uses: actions/setup-python@v5
with:
cache-dependency-path: uv.lock
python-version: "${{ matrix.python-version }}"
- name: Install django version
shell: bash
run: |
if [ ${{ matrix.broker == 'valkey' }} == true ]; then
additional_args="--extra valkey"
fi
uv sync --extra yaml $additional_args
uv pip install django==${{ matrix.django-version }}
- name: Get version
id: getVersion
shell: bash
run: |
VERSION=$(uv version --short)
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Check for missing migrations
run: |
cd testproject
uv run python manage.py makemigrations --check
- name: Run Tests without coverage
if: ${{ matrix.coverage != 'yes' }}
run: |
cd testproject
export FAKEREDIS=${{ matrix.broker == 'fakeredis' }}
if [ ${{ matrix.broker == 'valkey' }} == true ]; then
export BROKER_PORT=6380
else
export BROKER_PORT=6379
fi
uv run python manage.py test --exclude-tag multiprocess scheduler
# Steps for coverage check
- name: Run tests with coverage
uses: ./.github/actions/test-coverage
if: ${{ matrix.coverage == 'yes' }}
with:
pythonVer: ${{ matrix.python-version }}
djangoVer: ${{ matrix.django-version }}
repoToken: ${{ secrets.GITHUB_TOKEN }}
- name: Create coverage badge
if: ${{ matrix.coverage == 'yes' && github.event_name == 'push' }}
uses: schneegans/dynamic-badges-action@7142847813c746736c986b42dec98541e49a2cea
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: b756396efb895f0e34558c980f1ca0c7
filename: django-tasks-scheduler-4.json
label: coverage
message: ${{ env.COVERAGE }}%
color: green
# Prepare a draft release for GitHub Releases page for the manual verification
# If accepted and published, release workflow would be triggered
update_release_draft:
permissions:
# write permission is required to create a GitHub release
contents: write
# write permission is required for auto-labeler
# otherwise, read permission is required at least
pull-requests: write
needs: test-regular
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@b1476f6e6eb133afa41ed8589daba6dc69b4d3f5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}