name: Quality Checks on: push: branches: [ main, development, 'feature/**' ] pull_request: branches: [ main, development ] jobs: backend-quality: name: Backend (Go) runs-on: ubuntu-latest steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 - name: Set up Go uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 with: go-version: '1.25.5' cache-dependency-path: backend/go.sum - name: Run Go tests id: go-tests working-directory: ${{ github.workspace }} env: CGO_ENABLED: 1 run: | bash scripts/go-test-coverage.sh 2>&1 | tee backend/test-output.txt exit ${PIPESTATUS[0]} - name: Go Test Summary if: always() working-directory: backend run: | echo "## 🔧 Backend Test Results" >> $GITHUB_STEP_SUMMARY if [ "${{ steps.go-tests.outcome }}" == "success" ]; then echo "✅ **All tests passed**" >> $GITHUB_STEP_SUMMARY PASS_COUNT=$(grep -c "^--- PASS" test-output.txt || echo "0") echo "- Tests passed: $PASS_COUNT" >> $GITHUB_STEP_SUMMARY else echo "❌ **Tests failed**" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "### Failed Tests:" >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY grep -E "^--- FAIL|FAIL\s+github" test-output.txt || echo "See logs for details" grep -E "^--- FAIL|FAIL\s+github" test-output.txt >> $GITHUB_STEP_SUMMARY || echo "See logs for details" >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY fi # Codecov upload moved to `codecov-upload.yml` which is push-only. - name: Run golangci-lint uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0 with: version: latest working-directory: backend args: --timeout=5m continue-on-error: true - name: Run Perf Asserts working-directory: backend env: # Conservative defaults to avoid flakiness on CI; tune as necessary PERF_MAX_MS_GETSTATUS_P95: 500ms PERF_MAX_MS_GETSTATUS_P95_PARALLEL: 1500ms PERF_MAX_MS_LISTDECISIONS_P95: 2000ms run: | echo "## 🔍 Running performance assertions (TestPerf)" >> $GITHUB_STEP_SUMMARY go test -run TestPerf -v ./internal/api/handlers -count=1 | tee perf-output.txt exit ${PIPESTATUS[0]} frontend-quality: name: Frontend (React) runs-on: ubuntu-latest steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 - name: Set up Node.js uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version: '24.11.1' cache: 'npm' cache-dependency-path: frontend/package-lock.json - name: Install dependencies working-directory: frontend run: npm ci - name: Run frontend tests and coverage id: frontend-tests working-directory: ${{ github.workspace }} run: | bash scripts/frontend-test-coverage.sh 2>&1 | tee frontend/test-output.txt exit ${PIPESTATUS[0]} - name: Frontend Test Summary if: always() working-directory: frontend run: | echo "## ⚛️ Frontend Test Results" >> $GITHUB_STEP_SUMMARY if [ "${{ steps.frontend-tests.outcome }}" == "success" ]; then echo "✅ **All tests passed**" >> $GITHUB_STEP_SUMMARY # Extract test counts from vitest output if grep -q "Tests:" test-output.txt; then grep "Tests:" test-output.txt | tail -1 >> $GITHUB_STEP_SUMMARY fi else echo "❌ **Tests failed**" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "### Failed Tests:" >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY # Extract failed test info from vitest output grep -E "FAIL|✕|×|AssertionError|Error:" test-output.txt | head -30 >> $GITHUB_STEP_SUMMARY || echo "See logs for details" >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY fi # Codecov upload moved to `codecov-upload.yml` which is push-only. - name: Run frontend lint working-directory: frontend run: npm run lint continue-on-error: true