chore: pre-builds in CI

This commit is contained in:
James
2024-04-05 11:46:02 -04:00
parent 2c25abd143
commit 3bd455ced2
6 changed files with 37 additions and 8 deletions

View File

@@ -1,5 +1,6 @@
import { createServer } from 'http'
import nextImport from 'next'
import nextBuild from 'next/dist/build/index.js'
import path from 'path'
import { wait } from 'payload/utilities'
import { parse } from 'url'
@@ -32,9 +33,24 @@ export async function initPayloadE2ENoConfig<T extends GeneratedTypes<T>>({
await startMemoryDB()
// process.env.CI = 'true'
if (process.env.CI) {
await nextBuild.default(
path.resolve(dirname, '../../'),
false,
false,
false,
true,
true,
false,
'default',
)
}
// @ts-expect-error
const app = nextImport({
dev: true,
dev: !process.env.CI,
hostname: 'localhost',
port,
dir: path.resolve(dirname, '../../'),