AI: add agent.assert_tokens() for accumulated token limits #495
Workflow file for this run
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 ] | |
| pull_request: | |
| branches: [ "**" ] | |
| jobs: | |
| tests: | |
| name: Pytest | |
| runs-on: ubuntu-latest | |
| env: | |
| DB_HOST: 127.0.0.1 | |
| DB_PORT: 3306 | |
| DB_DATABASE: database_app_test | |
| DB_USERNAME: app | |
| DB_PASSWORD: secret | |
| POSTGRES_PORT: 15432 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Start MySQL | |
| run: docker compose -f docker-compose.yml up -d --wait | |
| # ── fastapi_startkit package ────────────────────────────────────────── | |
| - name: Install dependencies (fastapi_startkit) | |
| working-directory: fastapi_startkit | |
| run: uv sync --group dev --extra database --extra sqlite --extra fastapi --extra vite --extra postgres | |
| - name: Run tests (fastapi_startkit) | |
| working-directory: fastapi_startkit | |
| run: uv run pytest tests/ -v --cov --cov-report=xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| slug: fastapi-startkit/fastapi-startkit-framework | |
| files: fastapi_startkit/coverage.xml | |
| flags: fastapi_startkit | |
| fail_ci_if_error: false | |
| # ── example/config-app ──────────────────────────────────────────────── | |
| - name: Install dependencies (config-app) | |
| working-directory: example/config-app | |
| run: uv sync | |
| - name: Copy .env.example to .env (config-app) | |
| working-directory: example/config-app | |
| run: cp .env.example .env | |
| - name: Run tests (config-app) | |
| working-directory: example/config-app | |
| run: uv run pytest tests/ -v | |
| # ── example/database-app ────────────────────────────────────────────── | |
| - name: Install dependencies (database-app) | |
| working-directory: example/database-app | |
| run: uv sync | |
| - name: Run tests (database-app) | |
| working-directory: example/database-app | |
| run: uv run pytest tests/ -v | |
| # ── example/agents ──────────────────────────────────────────────────── | |
| - name: Install dependencies (agents) | |
| working-directory: example/agents | |
| run: uv sync | |
| - name: Build frontend assets (agents) | |
| working-directory: example/agents | |
| run: | | |
| npm ci | |
| npm run build | |
| - name: Copy .env.example to .env (agents) | |
| working-directory: example/agents | |
| run: cp .env.example .env | |
| - name: Run tests (agents) | |
| working-directory: example/agents | |
| run: uv run pytest tests/ -v | |
| - name: Stop MySQL | |
| if: always() | |
| run: docker compose -f docker-compose.yml down |