Repository navigation
feat(ops): Prometheus alert rules for backend monitoring #85
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] | |
| pull_request: | |
| # Cancel in-progress runs for the same PR/branch to save minutes. | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| backend: | |
| name: Backend (Maven tests) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '17' | |
| cache: maven | |
| - name: Make Maven wrapper executable | |
| run: chmod +x backend/mvnw | |
| # The integration test spins up its own pgvector Postgres via | |
| # Testcontainers, so no `services:` postgres block is needed here. | |
| - name: Run backend tests | |
| working-directory: backend | |
| run: ./mvnw -B test | |
| - name: Upload surefire reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: backend-test-reports | |
| path: backend/target/surefire-reports/ | |
| retention-days: 7 | |
| frontend: | |
| name: Frontend (Flutter analyze & test) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: stable | |
| cache: true | |
| - name: Cache pub packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.pub-cache | |
| frontend/.dart_tool | |
| key: pub-${{ runner.os }}-${{ hashFiles('frontend/pubspec.lock') }} | |
| restore-keys: pub-${{ runner.os }}- | |
| - name: Install dependencies | |
| working-directory: frontend | |
| run: flutter pub get | |
| - name: Analyze | |
| working-directory: frontend | |
| run: flutter analyze | |
| - name: Format check | |
| working-directory: frontend | |
| run: dart format --output=none --set-exit-if-changed lib test | |
| - name: Test | |
| working-directory: frontend | |
| run: flutter test | |
| - name: Upload test coverage | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: frontend-test-reports | |
| path: frontend/test/coverage/ | |
| retention-days: 7 | |
| security: | |
| name: Security (dependency review) | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Dependency review | |
| uses: actions/dependency-review-action@v4 | |
| with: | |
| fail-on-severity: high |