Comment out unused group_id indexes on usage_logs and budgets #73
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: | ||
| pull_request: | ||
| branches: [main, develop] | ||
| push: | ||
| branches: [develop] | ||
| jobs: | ||
| test-go: | ||
| runs-on: ubuntu-latest | ||
| services: | ||
| postgres: | ||
| image: postgres:15 | ||
| env: | ||
| POSTGRES_PASSWORD: postgres | ||
| POSTGRES_DB: pllm_test | ||
| options: >- | ||
| --health-cmd pg_isready | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
| ports: | ||
| - 5432:5432 | ||
| redis: | ||
| image: redis:7-alpine | ||
| options: >- | ||
| --health-cmd "redis-cli ping" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
| ports: | ||
| - 6379:6379 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: "1.23" | ||
| - name: Set up Node.js for docs build | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "20" | ||
| cache: "npm" | ||
| cache-dependency-path: | | ||
| web/package-lock.json | ||
| docs/package-lock.json | ||
| - name: Cache Go modules | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/go/pkg/mod | ||
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-go- | ||
| - name: Install dependencies | ||
| run: go mod download | ||
| - name: Install frontend dependencies | ||
| run: cd web && npm ci | ||
| - name: Install docs dependencies | ||
| run: cd docs && npm ci | ||
| - name: Build docs | ||
| run: make docs-build | ||
| - name: Generate Swagger docs | ||
| run: make swagger | ||
| - name: Run tests | ||
| env: | ||
| DATABASE_URL: postgres://postgres:postgres@localhost:5432/pllm_test?sslmode=disable | ||
| REDIS_URL: redis://localhost:6379 | ||
| run: make test-coverage | ||
| - name: Run linting | ||
| run: make lint | ||
| - name: Build | ||
| run: make build | ||
| - name: Upload coverage reports to Codecov | ||
| if: secrets.CODECOV_TOKEN != '' | ||
| uses: codecov/codecov-action@v5 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| slug: andreimerfu/pllm | ||
| test-frontend: | ||
| runs-on: ubuntu-latest | ||
| 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 frontend dependencies | ||
| run: | | ||
| cd web | ||
| npm ci | ||
| - name: Lint frontend | ||
| run: | | ||
| cd web | ||
| npm run lint | ||
| - name: Build frontend | ||
| run: | | ||
| cd web | ||
| npm run build | ||
| test-helm: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Helm | ||
| uses: azure/setup-helm@v4 | ||
| with: | ||
| version: v3.14.0 | ||
| - name: Add Helm repositories | ||
| run: | | ||
| helm repo add bitnami https://charts.bitnami.com/bitnami | ||
| helm repo add dexidp https://charts.dexidp.io | ||
| helm repo update | ||
| - name: Update Helm dependencies | ||
| run: | | ||
| cd deploy/helm/pllm | ||
| helm dependency update | ||
| - name: Lint Helm chart | ||
| run: | | ||
| cd deploy/helm | ||
| helm lint pllm | ||
| - name: Template Helm chart | ||
| run: | | ||
| cd deploy/helm | ||
| helm template pllm pllm \ | ||
| --set pllm.secrets.jwtSecret="test-jwt-secret" \ | ||
| --set pllm.secrets.masterKey="sk-master-test" \ | ||
| --set pllm.secrets.openaiApiKey="sk-test-openai" \ | ||
| --output-dir /tmp/helm-output | ||
| # Debug: list what was created | ||
| echo "Contents of /tmp/helm-output:" | ||
| find /tmp/helm-output -type f -name "*.yaml" | head -10 | ||
| # Find the generated manifest files and combine them | ||
| find /tmp/helm-output -name "*.yaml" -type f -exec cat {} \; > /tmp/pllm-manifests.yaml | ||
| # Verify the output file was created | ||
| echo "Size of combined manifest file:" | ||
| ls -la /tmp/pllm-manifests.yaml | ||
| - name: Validate Kubernetes manifests | ||
| run: | | ||
| if [ -f /tmp/pllm-manifests.yaml ]; then | ||
| echo "✅ Helm template generation successful" | ||
| echo "Manifest file size: $(wc -l < /tmp/pllm-manifests.yaml) lines" | ||
| # Basic validation - check if file contains valid YAML structure | ||
| head -20 /tmp/pllm-manifests.yaml | ||
| else | ||
| echo "❌ Manifest file not found" | ||
| exit 1 | ||
| fi | ||
| # security-scan: | ||
| # runs-on: ubuntu-latest | ||
| # permissions: | ||
| # contents: read | ||
| # security-events: write | ||
| # actions: read | ||
| # steps: | ||
| # - uses: actions/checkout@v4 | ||
| # - name: Run Trivy vulnerability scanner in repo mode | ||
| # uses: aquasecurity/trivy-action@master | ||
| # with: | ||
| # scan-type: 'fs' | ||
| # scan-ref: '.' | ||
| # format: 'sarif' | ||
| # output: 'trivy-results.sarif' | ||
| # - name: Upload Trivy scan results to GitHub Security tab | ||
| # uses: github/codeql-action/upload-sarif@v3 | ||
| # if: always() | ||
| # with: | ||
| # sarif_file: 'trivy-results.sarif' | ||
| # - name: Install Gosec | ||
| # run: go install github.com/securecodewarrior/gosec/v2/cmd/gosec@latest | ||
| # - name: Run Gosec Security Scanner | ||
| # run: | | ||
| # gosec -fmt sarif -out gosec-results.sarif ./... || echo "Gosec scan completed with issues" | ||
| # ls -la gosec-results.sarif | ||
| # - name: Upload Gosec scan results to GitHub Security tab | ||
| # uses: github/codeql-action/upload-sarif@v3 | ||
| # if: always() && hashFiles('gosec-results.sarif') != '' | ||
| # with: | ||
| # sarif_file: 'gosec-results.sarif' | ||