Fix isTestFile to correctly identify test files with words like lates… #355
Workflow file for this run
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: E2E Tests | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| paths-ignore: | |
| - "**.md" | |
| - "**.mdx" | |
| - "**.test.ts" | |
| - "**.test.tsx" | |
| - ".github/workflows/**" | |
| - ".claude/**" | |
| - "docs/**" | |
| - "infrastructure/**" | |
| workflow_dispatch: | |
| jobs: | |
| e2e: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Get Playwright version | |
| id: playwright-version | |
| run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').packages['node_modules/@playwright/test'].version)")" >> $GITHUB_ENV | |
| # Cache Playwright browsers to reduce download time | |
| # GitHub Actions cache limit: 10GB per repository, 7 days retention | |
| # Source: https://docs.github.com/en/actions/how-tos/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows | |
| - name: Cache Playwright browsers | |
| uses: actions/cache@v4 | |
| id: playwright-cache | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }} | |
| - name: Install Playwright browsers | |
| run: npx playwright install --with-deps | |
| if: steps.playwright-cache.outputs.cache-hit != 'true' | |
| - name: Install Playwright OS dependencies | |
| run: npx playwright install-deps | |
| if: steps.playwright-cache.outputs.cache-hit == 'true' | |
| # Cache Stripe CLI binary to avoid repeated downloads | |
| # GitHub Actions can cache any directory including system paths like /usr/local/bin | |
| # Cache limit: 10GB per repo, 7 days retention for unused caches | |
| # Source: https://docs.github.com/en/actions/how-tos/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows | |
| - name: Cache Stripe CLI | |
| uses: actions/cache@v4 | |
| id: stripe-cache | |
| with: | |
| path: /usr/local/bin/stripe | |
| key: ${{ runner.os }}-stripe-cli | |
| # https://docs.stripe.com/stripe-cli?install-method=apt#install | |
| - name: Install Stripe CLI | |
| if: steps.stripe-cache.outputs.cache-hit != 'true' | |
| run: | | |
| curl -s https://packages.stripe.dev/api/security/keypair/stripe-cli-gpg/public | gpg --dearmor | sudo tee /usr/share/keyrings/stripe.gpg | |
| echo "deb [signed-by=/usr/share/keyrings/stripe.gpg] https://packages.stripe.dev/stripe-cli-debian-local stable main" | sudo tee -a /etc/apt/sources.list.d/stripe.list | |
| sudo apt update | |
| sudo apt install stripe | |
| sudo cp $(which stripe) /usr/local/bin/stripe | |
| - name: Verify Stripe CLI | |
| run: stripe --version | |
| - name: Run E2E tests | |
| run: npx playwright test | |
| env: | |
| NODE_ENV: test | |
| BASE_URL: http://localhost:4000 | |
| # NextAuth configuration | |
| NEXTAUTH_URL: http://localhost:4000 | |
| NEXTAUTH_SECRET: "dummy-secret-for-testing" | |
| JWT_SECRET: "dummy-jwt-secret-for-testing" | |
| # GitHub OAuth credentials for E2E tests | |
| GITHUB_CLIENT_ID: ${{ secrets.GH_CLIENT_ID }} | |
| GITHUB_CLIENT_SECRET: ${{ secrets.GH_CLIENT_SECRET }} | |
| # GitHub login credentials for E2E tests | |
| GITHUB_USERNAME: ${{ secrets.GH_USERNAME }} | |
| GITHUB_PASSWORD: ${{ secrets.GH_PASSWORD }} | |
| GITHUB_OTP_SECRET: ${{ secrets.GH_OTP_SECRET }} | |
| # Stripe credentials for E2E tests | |
| STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }} | |
| STRIPE_WEBHOOK_SECRET: ${{ secrets.STRIPE_WEBHOOK_SECRET }} | |
| # Supabase credentials for E2E tests | |
| NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }} | |
| SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }} | |
| # Email service for NextAuth | |
| RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }} | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ |