# Cross-Platform CI Pipeline # # Tests on all target platforms (Linux, Windows, macOS) to catch # platform-specific bugs before they merge. ALL platforms must pass. # # Optimized: Frontend-only matrix, path filters to skip on docs-only changes. name: CI on: push: branches: [main, develop] paths: - 'apps/**' - 'package*.json' - 'tsconfig*.json' - 'biome.jsonc' - '.github/workflows/ci.yml' - '.github/actions/**' pull_request: branches: [main, develop] paths: - 'apps/**' - 'package*.json' - 'tsconfig*.json' - 'biome.jsonc' - '.github/workflows/ci.yml' - '.github/actions/**' concurrency: group: ci-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true permissions: contents: read actions: read pull-requests: write jobs: # -------------------------------------------------------------------------- # Frontend Tests - All Platforms # -------------------------------------------------------------------------- test-frontend: name: test-frontend (${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] steps: - name: Checkout repository uses: actions/checkout@v4 - name: Setup Node.js frontend uses: ./.github/actions/setup-node-frontend with: ignore-scripts: 'true' - name: Run TypeScript type check working-directory: apps/desktop run: npm run typecheck - name: Run unit tests with coverage if: matrix.os == 'ubuntu-latest' working-directory: apps/desktop run: npm run test:coverage - name: Run unit tests if: matrix.os != 'ubuntu-latest' working-directory: apps/desktop run: npm run test:unit - name: Run integration tests working-directory: apps/desktop run: npm run test:integration - name: Upload coverage report if: matrix.os == 'ubuntu-latest' && always() uses: actions/upload-artifact@v4 with: name: coverage-report path: apps/desktop/coverage/ retention-days: 14 - name: Coverage PR comment if: matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request' uses: davelosert/vitest-coverage-report-action@v2 with: working-directory: apps/desktop json-summary-path: coverage/coverage-summary.json json-final-path: coverage/coverage-final.json - name: Build application working-directory: apps/desktop run: npm run build # -------------------------------------------------------------------------- # Gate Job - Single check for branch protection # -------------------------------------------------------------------------- ci-complete: name: CI Complete runs-on: ubuntu-latest needs: [test-frontend] if: always() steps: - name: Check all CI jobs passed run: | echo "CI Job Results:" echo " test-frontend: ${{ needs.test-frontend.result }}" echo "" if [[ "${{ needs.test-frontend.result }}" != "success" ]]; then echo "❌ One or more CI jobs failed" exit 1 fi echo "✅ All CI checks passed"