Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

on:
push:
branches:
- "**"
pull_request:
branches:
- "main"

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5

- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.8.13"
enable-cache: true
cache-suffix: "optional-suffix"

- name: Set up Python
run: uv python install

- name: Setup Task
uses: arduino/setup-task@v2
with:
version: 3.x

- name: Install dependencies
run: task sync

- name: Format & lint
run: task lint

- name: Run tests
run: task test

- name: List available tasks (debug)
run: task --list
23 changes: 23 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: "3"

tasks:
default:
desc: "Run all tasks"
deps: [sync, lint, test]

sync:
desc: "Install dependencies"
cmds:
- uv sync
Comment on lines +8 to +11

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Install dev dependencies before lint/test

The sync task only runs uv sync, which installs the default dependency set. The tools invoked in the subsequent lint and test tasks (ruff, pytest, coverage) live in the [dependency-groups].dev section of pyproject.toml, so they are skipped when uv sync is called without --group dev or --all-groups. In CI this means the workflow will fail with ModuleNotFoundError as soon as linting or tests run. Please install the dev group (e.g. uv sync --group dev) or otherwise ensure these packages are present before executing lint/test steps.

Useful? React with 👍 / 👎.


lint:
desc: "Lint and format code"
cmds:
- uv run ruff check

test:
desc: "execute tests coverage"
cmds:
- uv run python -m coverage erase
- uv run python -m coverage run --source . -m pytest tests/ -vv --durations=5
- uv run python -m coverage report --skip-empty --omit "tests/*" -m
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ name = "ava-backend"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.11"
requires-python = ">=3.10"
dependencies = [
"fastapi",
"uvicorn",
"pydantic",
"python-dotenv",
"slack-sdk",
{ name = "pydantic-ai", extras = ["openai"] },
"pydantic-ai",
"httpx"
]

Expand Down
Loading