Skip to content

Add e2e tests, CI, AI crawlability files, and upgrade to Next.js 16 / mongodb 7 #3

Add e2e tests, CI, AI crawlability files, and upgrade to Next.js 16 / mongodb 7

Add e2e tests, CI, AI crawlability files, and upgrade to Next.js 16 / mongodb 7 #3

Workflow file for this run

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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: playwright-report-node-${{ matrix.node-version }}
path: playwright-report/
retention-days: 7
if-no-files-found: ignore