feat(repo): cleanup e2e cache on global setup (#18483)
This commit is contained in:
parent
d7d3ebc3a8
commit
0429536499
2
.github/workflows/e2e-matrix.yml
vendored
2
.github/workflows/e2e-matrix.yml
vendored
@ -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'
|
||||
|
||||
2
.github/workflows/e2e-windows.yml
vendored
2
.github/workflows/e2e-windows.yml
vendored
@ -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'
|
||||
|
||||
@ -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) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user