fix: close out Fable regression audit #376
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: CI | |
| on: | |
| push: | |
| branches: [main, development] | |
| pull_request: | |
| branches: [main, development] | |
| jobs: | |
| docs-ownership: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Enforce docs ownership | |
| env: | |
| # check_docs_ownership.py diffs from this SHA on push events; GitHub | |
| # does not export it by itself (PRs use GITHUB_BASE_REF instead). | |
| GITHUB_EVENT_BEFORE: ${{ github.event.before }} | |
| run: python scripts/check_docs_ownership.py | |
| test-backend: | |
| runs-on: ubuntu-latest | |
| needs: [docs-ownership] | |
| services: | |
| postgres: | |
| image: pgvector/pgvector:pg16 | |
| env: | |
| POSTGRES_DB: tribrid_test | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v3 | |
| - name: Set up Python | |
| run: uv python install 3.12 | |
| - name: Install dependencies | |
| run: uv sync --frozen | |
| - name: Run linting | |
| run: uv run ruff check server | |
| - name: Run type checking | |
| run: uv run mypy server | |
| - name: Config Reality Check | |
| run: uv run scripts/check_config_reality.py | |
| - name: Contract Bundle Check | |
| run: uv run scripts/validate_contract_bundle.py | |
| - name: Run tests | |
| env: | |
| POSTGRES_HOST: localhost | |
| POSTGRES_PORT: 5432 | |
| POSTGRES_DB: tribrid_test | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| run: uv run pytest tests/ -v --cov=server | |
| test-frontend: | |
| runs-on: ubuntu-latest | |
| needs: [docs-ownership] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: web/package-lock.json | |
| - name: Install dependencies | |
| working-directory: web | |
| run: npm ci | |
| - name: Run linting | |
| working-directory: web | |
| run: npm run lint | |
| - name: Type check | |
| working-directory: web | |
| run: npm run build | |
| build-docker: | |
| runs-on: ubuntu-latest | |
| needs: [test-backend, test-frontend] | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build Docker image | |
| run: docker build -t tribrid-rag:${{ github.sha }} . | |
| - name: Test Docker image | |
| run: | | |
| docker run -d --name test-container tribrid-rag:${{ github.sha }} | |
| sleep 10 | |
| docker logs test-container | |
| docker stop test-container |