add local ci
This commit is contained in:
@@ -28,6 +28,20 @@ def test(c):
|
||||
c.run("uv run pytest --cov=src --cov-report=term-missing")
|
||||
|
||||
|
||||
@task
|
||||
def ci(c):
|
||||
"""Run lint and tests in a clean Docker container."""
|
||||
image = "{{ cookiecutter.project_slug }}-ci"
|
||||
c.run(f"docker build --network=host -t {image} .")
|
||||
cmd = (
|
||||
"uv run ruff check src tests && "
|
||||
"uv run ruff format --check src tests && "
|
||||
"uv run mypy src && "
|
||||
"uv run pytest --cov=src --cov-report=term-missing"
|
||||
)
|
||||
c.run(f"docker run --rm {image} sh -c '{cmd}'")
|
||||
|
||||
|
||||
@task
|
||||
def clean(c):
|
||||
"""Preview files to delete (safe mode)."""
|
||||
|
||||
Reference in New Issue
Block a user