feat: add review history detail view with full results #10
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/CD | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - run: pip install ruff | |
| - run: ruff check backend/ | |
| test: | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| # Spin up PostgreSQL and Redis as service containers | |
| services: | |
| postgres: | |
| image: postgres:16-alpine | |
| env: | |
| POSTGRES_DB: test_codelens | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U postgres" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| redis: | |
| image: redis:7-alpine | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: pip install -r backend/requirements.txt | |
| - name: Run tests | |
| run: cd backend && python -m pytest tests/ -v --tb=short | |
| env: | |
| DATABASE_URL: postgresql+asyncpg://postgres:test@localhost:5432/test_codelens | |
| REDIS_URL: redis://localhost:6379 | |
| OPENAI_API_KEY: sk-test-key-not-real | |
| SECRET_KEY: test-secret-key | |
| APP_ENV: testing | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build Docker image | |
| run: docker build -t codelens-api ./backend | |
| - name: Verify image runs | |
| run: | | |
| docker run -d --name test-api \ | |
| -e OPENAI_API_KEY=sk-test \ | |
| -e SECRET_KEY=test \ | |
| -e DATABASE_URL=sqlite+aiosqlite:///test.db \ | |
| -e REDIS_URL=redis://localhost:6379 \ | |
| codelens-api | |
| sleep 3 | |
| docker logs test-api | |
| docker stop test-api |