Skip to content

Commit

Permalink
feat(repo): cleanup e2e cache on global setup (#18483)
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav committed Aug 8, 2023
1 parent d7d3ebc commit 0429536
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
12 changes: 7 additions & 5 deletions e2e/utils/global-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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) => {
Expand Down

1 comment on commit 0429536

@vercel
Copy link

@vercel vercel bot commented on 0429536 Aug 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-git-master-nrwl.vercel.app
nx.dev
nx-dev-nrwl.vercel.app
nx-five.vercel.app

Please sign in to comment.