ci: add test workflow for lint + pytest on server changes #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "app/**" | |
| - "tests/**" | |
| - "cli/**" | |
| - "pyproject.toml" | |
| - "requirements*.txt" | |
| - ".github/workflows/test.yml" | |
| pull_request: | |
| paths: | |
| - "app/**" | |
| - "tests/**" | |
| - "cli/**" | |
| - "pyproject.toml" | |
| - "requirements*.txt" | |
| - ".github/workflows/test.yml" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: test-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: Lint & test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.14" | |
| cache: "pip" | |
| cache-dependency-path: | | |
| pyproject.toml | |
| requirements*.txt | |
| # ββ Install from pyproject.toml (dev extra pulls pytest + ruff) βββββββββ | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e '.[dev]' | |
| # ββ Lint ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| - name: Ruff check | |
| run: ruff check app/ tests/ cli/cli.py | |
| - name: Ruff format check | |
| run: ruff format --check app/ tests/ cli/cli.py | |
| # ββ Tests βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| - name: Pytest | |
| run: pytest tests/ -v |