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
21 changes: 13 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
name: Tests

on:
pull_request:
push:
branches:
- main
branches: [main, dev]
pull_request:
branches: [main]

jobs:
non-llm-tests:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v4
with:
version: "latest"

- name: Set up Python
run: uv python install 3.11
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Install dependencies
run: uv sync --extra dev

- name: Run non-LLM tests
run: uv run pytest -q -m "not llm"
run: uv run pytest -q -m "not llm" --tb=short
10 changes: 9 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ authors = [
{ name = "Nhat Quang Dang", email = "dangnhatquang199@gmail.com" },
]
requires-python = ">=3.10,<3.14"
dependencies = ["crewai[tools]==1.14.4", "pyyaml>=6.0", "python-dotenv>=1.0.0"]

dependencies = [
"crewai[tools]==1.14.4",
"pyyaml>=6.0",
"python-dotenv>=1.0.0",
"ollama>=0.6.2",
]

[project.optional-dependencies]
dev = ["pytest>=8.0.0", "pytest-cov>=5.0.0"]
Expand All @@ -20,6 +26,8 @@ train = "bandai.main:train"
replay = "bandai.main:replay"
test = "bandai.main:test"
run_with_trigger = "bandai.main:run_with_trigger"
kickoff = "bandai.main:run"
pytest_unit = "bandai.main:run_pytest"

[build-system]
requires = ["hatchling"]
Expand Down
5 changes: 5 additions & 0 deletions src/bandai/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ def test() -> None:
_run_command(["crewai", "test", *sys.argv[1:]])


def run_pytest() -> None:
"""Run unit tests (pytest) via the project script uv run pytest_unit."""
_run_command(["pytest", "tests/", "-v", *sys.argv[1:]])


def run_with_trigger() -> None:
"""Run the BandAI pipeline from an external trigger (webhook/API)."""
run()
Expand Down
Loading
Loading