Merge pull request #1417 from broda-spendy/fix/1304-enforce-cargo-check #55
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: Test Coverage & Quality Trends | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| jobs: | |
| coverage-backend: | |
| name: Backend Test Coverage (Threshold >= 80%) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install Dependencies | |
| working-directory: ./backend | |
| run: npm ci | |
| - name: Run Backend Tests with Coverage | |
| working-directory: ./backend | |
| run: npm run test -- --coverage --coverageReporters="json-summary" "text" "lcov" | |
| - name: Upload Backend Coverage Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: backend-coverage-report | |
| path: backend/coverage/ | |
| coverage-frontend: | |
| name: Frontend Test Coverage (Threshold >= 70%) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install Dependencies | |
| working-directory: ./frontend | |
| run: npm ci | |
| - name: Run Frontend Tests with Coverage | |
| working-directory: ./frontend | |
| run: npm run test:run -- --coverage | |
| - name: Upload Frontend Coverage Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: frontend-coverage-report | |
| path: frontend/coverage/ | |
| coverage-threshold-check: | |
| name: Verify Coverage Thresholds & Alert on Drops | |
| runs-on: ubuntu-latest | |
| needs: [coverage-backend, coverage-frontend] | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Download Backend Coverage Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: backend-coverage-report | |
| path: backend/coverage/ | |
| - name: Download Frontend Coverage Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: frontend-coverage-report | |
| path: frontend/coverage/ | |
| - name: Enforce Coverage Minimum Thresholds | |
| run: node scripts/check-coverage-thresholds.js |