Context
This repo currently publishes to PyPI (python-publish-pypi.yml / python-publish-pypi-test.yml) with no automated verification step: no test suite runs, no linting/type-checking gate, and no check that LAST_VERSION, pyproject.toml, and mkdocs_dracula_theme/__init__.py actually agree on the version being released. A release can currently ship even if those three drift out of sync.
Goal
Add a CI safety net so releases only go out once tests and code-quality checks pass, and once the version is verified consistent across all three sources of truth.
Concepts / building blocks
verify-version action — new composite action that compares LAST_VERSION against pyproject.toml's version and mkdocs_dracula_theme/__init__.py's __version__, failing the run on any mismatch.
test.yml workflow — runs pytest (with coverage) across a Python version matrix (3.9–3.13), reusable via workflow_call.
code-quality.yml workflow — runs ruff check, ruff format --check, and mypy across the same matrix, reusable via workflow_call.
.code_quality/ — new ruff.toml and mypy.ini config, since none exist yet.
tests/ — new directory with a minimal smoke-test suite for the theme package, since none exists yet.
- Poetry dependency groups — add
dev (pytest, pytest-cov) and code-quality (ruff, mypy) groups to pyproject.toml.
- Publish workflow gating —
python-publish-pypi.yml and python-publish-pypi-test.yml call test.yml + code-quality.yml as required jobs before the deploy job runs, and call verify-version before building the package.
setup-poetry action fix — cache key currently ignores the Python version, so cross-version runs can collide on the same cache entry; key needs ${{ inputs.python-version }} added.
Scope
Context
This repo currently publishes to PyPI (
python-publish-pypi.yml/python-publish-pypi-test.yml) with no automated verification step: no test suite runs, no linting/type-checking gate, and no check thatLAST_VERSION,pyproject.toml, andmkdocs_dracula_theme/__init__.pyactually agree on the version being released. A release can currently ship even if those three drift out of sync.Goal
Add a CI safety net so releases only go out once tests and code-quality checks pass, and once the version is verified consistent across all three sources of truth.
Concepts / building blocks
verify-versionaction — new composite action that comparesLAST_VERSIONagainstpyproject.toml'sversionandmkdocs_dracula_theme/__init__.py's__version__, failing the run on any mismatch.test.ymlworkflow — runspytest(with coverage) across a Python version matrix (3.9–3.13), reusable viaworkflow_call.code-quality.ymlworkflow — runsruff check,ruff format --check, andmypyacross the same matrix, reusable viaworkflow_call..code_quality/— newruff.tomlandmypy.iniconfig, since none exist yet.tests/— new directory with a minimal smoke-test suite for the theme package, since none exists yet.dev(pytest, pytest-cov) andcode-quality(ruff, mypy) groups topyproject.toml.python-publish-pypi.ymlandpython-publish-pypi-test.ymlcalltest.yml+code-quality.ymlas required jobs before thedeployjob runs, and callverify-versionbefore building the package.setup-poetryaction fix — cache key currently ignores the Python version, so cross-version runs can collide on the same cache entry; key needs${{ inputs.python-version }}added.Scope
verify-versioncomposite actionsetup-poetrycache key (include Python version) + addpoetry lockfallbacktest.ymlworkflow + minimaltests/suitecode-quality.ymlworkflow +.code_quality/ruff.toml+.code_quality/mypy.inidevandcode-qualitypoetry dependency groups topyproject.tomlpython-publish-pypi.ymlon tests + code quality + version verificationpython-publish-pypi-test.ymlon tests + code quality + version verification