Skip to content

Commit 3d2ee88

Browse files
mpasternakclaude
andcommitted
ci: add GitHub Actions workflow (pytest matrix + pre-commit)
- pre-commit job runs ruff and the standard hygiene hooks. - test job matrices Python 3.10-3.13 × Django 4.2/5.0/5.1/5.2, excluding combos Django doesn't support (3.13 × 4.2, 3.13 × 5.0). Tests use testcontainers — runners ship Docker so no service container declaration is needed. - README gets a CI badge. - pyproject classifies Django 4.2 (matches the >=4.2 dep and the matrix); the missing classifier was an oversight. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f0454ee commit 3d2ee88

3 files changed

Lines changed: 54 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
pre-commit:
17+
name: pre-commit
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.12"
24+
- uses: pre-commit/action@v3.0.1
25+
26+
test:
27+
name: py${{ matrix.python-version }} / django ${{ matrix.django }}
28+
runs-on: ubuntu-latest
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
python-version: ["3.10", "3.11", "3.12", "3.13"]
33+
django: ["4.2", "5.0", "5.1", "5.2"]
34+
exclude:
35+
- python-version: "3.13"
36+
django: "4.2"
37+
- python-version: "3.13"
38+
django: "5.0"
39+
steps:
40+
- uses: actions/checkout@v4
41+
- name: Set up uv
42+
uses: astral-sh/setup-uv@v5
43+
with:
44+
python-version: ${{ matrix.python-version }}
45+
- name: Install package and test deps
46+
run: |
47+
uv pip install --system -e ".[test]"
48+
uv pip install --system "Django~=${{ matrix.django }}.0"
49+
- name: Show resolved versions
50+
run: uv pip list --system
51+
- name: Run pytest
52+
run: pytest -v

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# django-formdefaults
22

3+
[![tests](https://github.com/iplweb/django-formdefaults/actions/workflows/tests.yml/badge.svg)](https://github.com/iplweb/django-formdefaults/actions/workflows/tests.yml)
34
[![PyPI version](https://img.shields.io/pypi/v/django-formdefaults.svg)](https://pypi.org/project/django-formdefaults/)
45
[![Python versions](https://img.shields.io/pypi/pyversions/django-formdefaults.svg)](https://pypi.org/project/django-formdefaults/)
56
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ classifiers = [
2424
"Development Status :: 4 - Beta",
2525
"Environment :: Web Environment",
2626
"Framework :: Django",
27+
"Framework :: Django :: 4.2",
2728
"Framework :: Django :: 5.0",
2829
"Framework :: Django :: 5.1",
2930
"Framework :: Django :: 5.2",

0 commit comments

Comments
 (0)