Add e2e tests, CI, AI crawlability files, and upgrade to Next.js 16 / mongodb 7 #1
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: CI | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| jobs: | |
| build-and-e2e: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| max-parallel: 1 | |
| matrix: | |
| node-version: [20.x, 22.x] | |
| services: | |
| mongodb: | |
| image: mongo:latest | |
| options: >- | |
| --health-cmd "mongosh --eval 'db.adminCommand({ ping: 1 })'" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 27017:27017 | |
| env: | |
| MONGODB_URI: mongodb://localhost:27017/nextjs_template?appName=nextjs-template-mongodb-ci | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint | |
| run: npm run lint | |
| - name: Build | |
| run: npm run build | |
| - name: Install Playwright browser | |
| run: npx playwright install --with-deps chromium | |
| - name: Run end-to-end tests | |
| run: npm run test:e2e | |
| - name: Upload Playwright report | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report-node-${{ matrix.node-version }} | |
| path: playwright-report/ | |
| retention-days: 7 | |
| if-no-files-found: ignore |