name: Test Local Dev Environment on: push: branches: [main] pull_request: branches: [main] jobs: test-dev: name: Test Local Dev Startup runs-on: ubuntu-latest env: NEXT_PUBLIC_WWV_EDITION: local AUTH_SECRET: ci-placeholder-secret-not-used-in-tests steps: - uses: actions/checkout@v6 - uses: pnpm/action-setup@v6 - uses: actions/setup-node@v6 with: node-version: 22 cache: pnpm - name: Create coolify docker network # Needed because docker-compose.yml references external coolify network run: docker network create coolify || true - name: Install dependencies run: pnpm install --frozen-lockfile - name: Setup environment run: cp .env.example .env - name: Test predev setup # Tests that Docker DB boots, port mappings work, Prisma pushes schema, and plugins sync run: pnpm run predev - name: Test dev server startup run: | # Start the dev server in the background pnpm run dev & DEV_PID=$! echo "Waiting for Next.js to respond on port 3000..." # Wait up to 120 seconds for the dev server to return a response timeout 120 bash -c 'until curl -s http://localhost:3000 > /dev/null; do sleep 5; done' # Check if the process is still running if ! kill -0 $DEV_PID 2>/dev/null; then echo "Dev server crashed or failed to start within timeout!" exit 1 fi echo "Dev server started successfully!" # Graceful shutdown kill $DEV_PID