fix(auth): disable undici+gRPC OTel instrumentations causing login de… #295
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: | |
| branches: [main] | |
| jobs: | |
| lint-and-test: | |
| name: Lint, Type Check, and Test | |
| runs-on: ubuntu-latest | |
| env: | |
| # Firebase configuration (public - safe to expose) | |
| NEXT_PUBLIC_FIREBASE_API_KEY: "AIzaSyDviqCSH3GDsT2zHScYV-fCzpc0UU__2Wo" | |
| NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: "hustleapp-production.firebaseapp.com" | |
| NEXT_PUBLIC_FIREBASE_PROJECT_ID: "hustleapp-production" | |
| NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: "hustleapp-production.firebasestorage.app" | |
| NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: "335713777643" | |
| NEXT_PUBLIC_FIREBASE_APP_ID: "1:335713777643:web:209e728afd5aee07c80bae" | |
| # E2E test mode - must be at job level for build-time embedding | |
| NEXT_PUBLIC_E2E_TEST_MODE: 'true' | |
| # Firebase Admin (private - from secrets) | |
| FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }} | |
| FIREBASE_CLIENT_EMAIL: ${{ secrets.FIREBASE_CLIENT_EMAIL }} | |
| FIREBASE_PRIVATE_KEY: ${{ secrets.FIREBASE_PRIVATE_KEY }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Cache Playwright browsers | |
| uses: actions/cache@v4 | |
| id: playwright-cache | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} | |
| - name: Run ESLint | |
| run: npm run lint | |
| - name: Type check | |
| run: npx tsc --noEmit | |
| continue-on-error: true # Pre-existing type debt - don't block CI | |
| - name: Build application | |
| run: npm run build | |
| - name: Run unit tests | |
| run: npm run test:unit | |
| continue-on-error: true # Some tests need STRIPE_SECRET_KEY and better mocks | |
| env: | |
| STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }} | |
| - name: Set up Java 21 (required by Firebase emulators) | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Run integration tests | |
| run: npx firebase emulators:exec --only auth,firestore 'npm run test:integration' | |
| continue-on-error: true # New infrastructure — don't block CI while stabilizing | |
| env: | |
| FIREBASE_PROJECT_ID: hustle-test | |
| FIRESTORE_EMULATOR_HOST: 127.0.0.1:8080 | |
| FIREBASE_AUTH_EMULATOR_HOST: 127.0.0.1:9099 | |
| - name: Install Playwright browsers | |
| if: steps.playwright-cache.outputs.cache-hit != 'true' | |
| run: npx playwright install --with-deps chromium | |
| - name: Run E2E tests | |
| run: npm run test:e2e -- --project=chromium | |
| env: | |
| PLAYWRIGHT_BASE_URL: http://localhost:4000 | |
| E2E_TEST_EMAIL: ${{ secrets.E2E_TEST_EMAIL }} | |
| E2E_TEST_PASSWORD: ${{ secrets.E2E_TEST_PASSWORD }} | |
| - name: Run security audit | |
| run: npm run test:security | |
| continue-on-error: true # Don't fail on moderate vulnerabilities | |
| - name: Upload Playwright report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report | |
| path: 03-Tests/playwright-report/ | |
| retention-days: 14 | |
| - name: Upload test results on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results | |
| path: test-results/ | |
| retention-days: 14 | |
| build-docker: | |
| name: Build Docker Image | |
| runs-on: ubuntu-latest | |
| needs: lint-and-test | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Build Docker image | |
| run: docker build -f Dockerfile -t hustle-app:${{ github.sha }} . | |
| - name: Test Docker image | |
| run: | | |
| docker run -d -p 8080:8080 --name test-app \ | |
| -e NODE_ENV=production \ | |
| -e NEXT_PUBLIC_FIREBASE_PROJECT_ID=hustleapp-production \ | |
| -e FIREBASE_PROJECT_ID=hustleapp-production \ | |
| hustle-app:${{ github.sha }} | |
| echo "Waiting for container startup..." | |
| sleep 15 | |
| docker logs test-app || true | |
| curl -sf --max-time 10 http://localhost:8080/api/healthcheck || \ | |
| (echo "Health check failed - container logs:" && docker logs test-app && exit 1) | |
| docker stop test-app |