Test #21
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: | |
| # ββ Lint runs once, no backend dependency. βββββββββββββββββββββββββββββββββββ | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.14" | |
| cache: "pip" | |
| cache-dependency-path: | | |
| pyproject.toml | |
| requirements*.txt | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e '.[dev]' | |
| pip install -e cli/ | |
| - name: Ruff check | |
| run: ruff check app/ tests/ cli/ | |
| - name: Ruff format check | |
| run: ruff format --check app/ tests/ cli/ | |
| # ββ Test matrix: both backends, since prod runs Redis but most local | |
| # development uses SQLite β we need either to break the build, not | |
| # just the one that happens to match the developer's setup. | |
| test: | |
| name: Test (${{ matrix.backend }}) | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| backend: [sqlite, redis] | |
| services: | |
| redis: | |
| image: redis:7-alpine | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 5s | |
| --health-timeout 3s | |
| --health-retries 10 | |
| env: | |
| STORAGE_BACKEND: ${{ matrix.backend }} | |
| REDIS_URL: redis://localhost:6379 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.14" | |
| cache: "pip" | |
| cache-dependency-path: | | |
| pyproject.toml | |
| requirements*.txt | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e '.[dev]' | |
| pip install -e cli/ | |
| - name: Pytest | |
| run: pytest tests/ -v |