diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 19a57c7..7487db2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -175,6 +175,9 @@ jobs: if: steps.playwright-cache.outputs.cache-hit == 'true' run: pnpm exec playwright install-deps chromium + - name: Build for production + run: pnpm build + - name: Run E2E tests run: pnpm test:e2e env: diff --git a/playwright.config.ts b/playwright.config.ts index 410e250..b8a79dc 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -39,16 +39,31 @@ export default defineConfig({ }, }, ], - webServer: [ - { - command: "pnpm --filter @trails-cool/journal dev", - url: "http://localhost:3000", - reuseExistingServer: !process.env.CI, - }, - { - command: "pnpm --filter @trails-cool/planner dev", - url: "http://localhost:3001", - reuseExistingServer: !process.env.CI, - }, - ], + webServer: process.env.CI + ? [ + { + command: "npx react-router-serve ./build/server/index.js", + url: "http://localhost:3000", + cwd: "./apps/journal", + reuseExistingServer: false, + }, + { + command: "node --experimental-strip-types server.ts", + url: "http://localhost:3001", + cwd: "./apps/planner", + reuseExistingServer: false, + }, + ] + : [ + { + command: "pnpm --filter @trails-cool/journal dev", + url: "http://localhost:3000", + reuseExistingServer: true, + }, + { + command: "pnpm --filter @trails-cool/planner dev", + url: "http://localhost:3001", + reuseExistingServer: true, + }, + ], });