feat(repo): cleanup e2e cache on global setup (#18483)

This commit is contained in:
Miroslav Jonaš 2023-08-08 20:07:02 +02:00 committed by GitHub
parent d7d3ebc3a8
commit 0429536499
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 7 deletions

View File

@ -414,7 +414,7 @@ jobs:
npm_config_registry: http://localhost:4872
YARN_REGISTRY: http://localhost:4872
NX_CACHE_DIRECTORY: 'tmp'
NX_E2E_SKIP_BUILD_CLEANUP: 'true'
NX_E2E_SKIP_CLEANUP: 'true'
NX_E2E_RUN_E2E: 'true'
NX_E2E_VERBOSE_LOGGING: 'true'
NX_PERF_LOGGING: 'false'

View File

@ -302,7 +302,7 @@ jobs:
SELECTED_PM: ${{ matrix.package_manager }}
npm_config_registry: http://localhost:4872
NX_CACHE_DIRECTORY: 'tmp'
NX_E2E_SKIP_BUILD_CLEANUP: 'true'
NX_E2E_SKIP_CLEANUP: 'true'
NX_E2E_RUN_E2E: 'true'
NX_E2E_VERBOSE_LOGGING: 'true'
NX_PERF_LOGGING: 'false'

View File

@ -2,8 +2,10 @@ import { startLocalRegistry } from '@nx/js/plugins/jest/local-registry';
import { join } from 'path';
import { exec } from 'child_process';
import { tmpdir } from 'tmp';
import { existsSync } from 'fs-extra';
import { existsSync, removeSync } from 'fs-extra';
import { Config } from '@jest/types';
import { e2eCwd } from './get-env-info';
import * as isCI from 'is-ci';
export default async function (globalConfig: Config.ConfigGlobals) {
const isVerbose: boolean =
@ -19,10 +21,10 @@ export default async function (globalConfig: Config.ConfigGlobals) {
storage: storageLocation,
});
if (
process.env.NX_E2E_SKIP_BUILD_CLEANUP !== 'true' ||
!existsSync('./build')
) {
if (process.env.NX_E2E_SKIP_CLEANUP !== 'true' || !existsSync('./build')) {
if (!isCI) {
removeSync(e2eCwd);
}
console.log('Publishing packages to local registry');
const publishVersion = process.env.PUBLISHED_VERSION ?? 'major';
await new Promise<void>((res, rej) => {