fix: skip ClerkProvider when publishableKey missing during SSG build #90
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 Suite | |
| on: | |
| pull_request: | |
| branches: [main, develop] | |
| push: | |
| branches: [main, develop] | |
| jobs: | |
| unit-and-integration-tests: | |
| name: Unit & Integration Tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| strategy: | |
| matrix: | |
| node-version: [20.x] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run linter | |
| run: npm run lint | |
| - name: Run type check | |
| run: npm run type-check | |
| - name: Run unit tests | |
| run: npm run test:unit | |
| env: | |
| NODE_ENV: test | |
| - name: Run integration tests | |
| run: npm run test:integration | |
| env: | |
| NODE_ENV: test | |
| - name: Generate coverage report | |
| run: npm run test:coverage | |
| env: | |
| NODE_ENV: test | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./coverage/lcov.info | |
| flags: unittests | |
| name: codecov-umbrella | |
| fail_ci_if_error: false | |
| - name: Upload coverage artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-reports | |
| path: | | |
| coverage/ | |
| test-results/ | |
| retention-days: 30 | |
| e2e-tests: | |
| name: E2E Tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| project: [chromium, firefox, webkit] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install Playwright browsers | |
| run: npx playwright install --with-deps ${{ matrix.project }} | |
| - name: Run E2E tests | |
| run: npm run test:e2e -- --project=${{ matrix.project }} | |
| env: | |
| NODE_ENV: test | |
| CI: true | |
| - name: Upload Playwright report | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: playwright-report-${{ matrix.project }} | |
| path: playwright-report/ | |
| retention-days: 30 | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-results-${{ matrix.project }} | |
| path: test-results/ | |
| retention-days: 30 | |
| test-summary: | |
| name: Test Summary | |
| runs-on: ubuntu-latest | |
| needs: [unit-and-integration-tests, e2e-tests] | |
| if: always() | |
| steps: | |
| - name: Check test results | |
| run: | | |
| if [ "${{ needs.unit-and-integration-tests.result }}" != "success" ]; then | |
| echo "Unit/Integration tests failed" | |
| exit 1 | |
| fi | |
| if [ "${{ needs.e2e-tests.result }}" != "success" ]; then | |
| echo "E2E tests failed" | |
| exit 1 | |
| fi | |
| echo "All tests passed!" | |
| - name: Post summary | |
| run: | | |
| echo "## Test Results" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "- Unit & Integration Tests: ${{ needs.unit-and-integration-tests.result }}" >> $GITHUB_STEP_SUMMARY | |
| echo "- E2E Tests: ${{ needs.e2e-tests.result }}" >> $GITHUB_STEP_SUMMARY |