fix(e2e): Wait for correct API endpoint (/api/list-schemas) #72
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, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read # Needed to checkout the repository | |
| pull-requests: write # Needed for PR comments | |
| deployments: write # Needed for GitHub deployments | |
| env: # Add job-level env vars | |
| ACTIONS_RUNNER_DEBUG: true | |
| ACTIONS_STEP_DEBUG: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check VERCEL env var | |
| run: | | |
| echo "VERCEL value: $VERCEL" | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v3 | |
| with: | |
| version: 10 | |
| run_install: false | |
| - name: Use Node.js 20.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: "pnpm" | |
| # Setup .next/cache directory cache with 2025-compatible approach | |
| - name: Setup Next.js cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .next/cache | |
| ${{ github.workspace }}/.next/cache | |
| key: ${{ runner.os }}-${{ runner.arch }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ runner.arch }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}- | |
| ${{ runner.os }}-${{ runner.arch }}-nextjs- | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Lint | |
| run: pnpm lint | |
| - name: Format check | |
| run: pnpm format --check | |
| - name: Build | |
| run: pnpm build --debug | |
| env: | |
| NEXT_TELEMETRY_DISABLED: 1 | |
| NODE_OPTIONS: "--max_old_space_size=4096" | |
| NEXTJS_DEBUG: 1 | |
| - name: Check Schemas in Build Output | |
| run: | | |
| echo "Checking build output (.next)..." | |
| ls -R .next | |
| echo "Finished checking build output." | |
| - name: Update apt packages | |
| run: sudo apt-get update -y | |
| - name: Install Playwright Browsers | |
| run: npx playwright install --with-deps | |
| - name: Run unit tests | |
| run: pnpm test | |
| - name: Run Playwright e2e tests | |
| run: pnpm test:e2e | |
| # Create a Vercel preview deployment for PR using modern 2025 approach | |
| - name: Deploy Preview to Vercel | |
| if: github.event_name == 'pull_request' | |
| uses: BetaHuhn/deploy-to-vercel-action@v1 | |
| with: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| PRODUCTION: false | |
| DEPLOY_PR_FROM_FORK: false | |
| CREATE_COMMENT: true | |
| GITHUB_DEPLOYMENT: true |