mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
ci: Exclude test controller in CI by default (#18136)
This commit is contained in:
@@ -49,6 +49,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
build-command: ${{ inputs.test-mode == 'docker-build' && 'pnpm build:docker' || 'pnpm turbo build:playwright' }}
|
build-command: ${{ inputs.test-mode == 'docker-build' && 'pnpm build:docker' || 'pnpm turbo build:playwright' }}
|
||||||
enable-docker-cache: ${{ inputs.test-mode != 'local' }}
|
enable-docker-cache: ${{ inputs.test-mode != 'local' }}
|
||||||
|
env:
|
||||||
|
INCLUDE_TEST_CONTROLLER: ${{ inputs.test-mode == 'docker-build' && 'true' || '' }}
|
||||||
|
|
||||||
- name: Install Browsers (Docker Build)
|
- name: Install Browsers (Docker Build)
|
||||||
if: inputs.test-mode == 'docker-build'
|
if: inputs.test-mode == 'docker-build'
|
||||||
|
|||||||
@@ -14,6 +14,10 @@ import path from 'path';
|
|||||||
// Check if running in a CI environment
|
// Check if running in a CI environment
|
||||||
const isCI = process.env.CI === 'true';
|
const isCI = process.env.CI === 'true';
|
||||||
|
|
||||||
|
// Check if test controller should be excluded (CI + flag not set)
|
||||||
|
const excludeTestController =
|
||||||
|
process.env.CI === 'true' && process.env.INCLUDE_TEST_CONTROLLER !== 'true';
|
||||||
|
|
||||||
// Disable verbose output and force color only if not in CI
|
// Disable verbose output and force color only if not in CI
|
||||||
$.verbose = !isCI;
|
$.verbose = !isCI;
|
||||||
process.env.FORCE_COLOR = isCI ? '0' : '1';
|
process.env.FORCE_COLOR = isCI ? '0' : '1';
|
||||||
@@ -169,6 +173,15 @@ startTimer('package_deploy');
|
|||||||
|
|
||||||
await fs.ensureDir(config.compiledAppDir);
|
await fs.ensureDir(config.compiledAppDir);
|
||||||
|
|
||||||
|
if (excludeTestController) {
|
||||||
|
const cliPackagePath = path.join(config.rootDir, 'packages/cli/package.json');
|
||||||
|
const content = await fs.readFile(cliPackagePath, 'utf8');
|
||||||
|
const packageJson = JSON.parse(content);
|
||||||
|
packageJson.files.push('!dist/**/e2e.*');
|
||||||
|
await fs.writeFile(cliPackagePath, JSON.stringify(packageJson, null, 2));
|
||||||
|
echo(chalk.gray(' - Excluded test controller from packages/cli/package.json'));
|
||||||
|
}
|
||||||
|
|
||||||
await $`cd ${config.rootDir} && NODE_ENV=production DOCKER_BUILD=true pnpm --filter=n8n --prod --legacy deploy --no-optional ./compiled`;
|
await $`cd ${config.rootDir} && NODE_ENV=production DOCKER_BUILD=true pnpm --filter=n8n --prod --legacy deploy --no-optional ./compiled`;
|
||||||
|
|
||||||
const packageDeployTime = getElapsedTime('package_deploy');
|
const packageDeployTime = getElapsedTime('package_deploy');
|
||||||
|
|||||||
Reference in New Issue
Block a user