From 4852eee2ab15d3f7af63d0edc0ff3f3c836af6d7 Mon Sep 17 00:00:00 2001 From: Simon Critchley Date: Mon, 11 Sep 2023 19:46:37 +0100 Subject: [PATCH] Revert "feat(repo): add cloud workflows" This reverts commit 018d9972eed60a3836b0eb65559cf1913029a4c8. --- .circleci/config.yml | 131 +++++++++++++++---- .gitignore | 13 +- .nx/workflows/agents.yaml | 58 -------- e2e/esbuild/src/esbuild.test.ts | 2 +- e2e/nx-misc/src/watch.test.ts | 6 +- e2e/utils/get-env-info.ts | 3 +- packages/nx/src/native/tests/watcher.spec.ts | 2 +- 7 files changed, 111 insertions(+), 104 deletions(-) delete mode 100644 .nx/workflows/agents.yaml diff --git a/.circleci/config.yml b/.circleci/config.yml index 8b1bcc1e02c61..206d5eb5db8a0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -69,10 +69,91 @@ commands: - ~/.pnpm-store - ~/.cache/Cypress - node_modules + + setup: + parameters: + os: + type: string + steps: + - checkout + - when: + condition: + equal: [<< parameters.os >>, macos] + steps: + - restore_cache: + name: Restore Homebrew packages + keys: + - nrwl-nx-homebrew-packages + - run: + name: Configure Detox Environment, Install applesimutils + command: | + HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null + HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null + xcrun simctl shutdown all && xcrun simctl erase all + no_output_timeout: 20m + - save_cache: + name: Save Homebrew Cache + key: nrwl-nx-homebrew-packages + paths: + - /usr/local/Homebrew + - ~/Library/Caches/Homebrew + - when: + condition: + equal: [<< parameters.os >>, linux] + steps: + - run: + command: | + sudo apt-get update + sudo apt-get install -y ca-certificates lsof + - browser-tools/install-chrome + - browser-tools/install-chromedriver + - run-pnpm-install: + os: << parameters.os >> + # ------------------------- # JOBS # ------------------------- jobs: + # ------------------------- + # JOBS: Agent + # ------------------------- + agent: + parameters: + os: + type: string + default: 'linux' + pm: + type: string + default: 'pnpm' + executor: << parameters.os >> + environment: + GIT_AUTHOR_EMAIL: test@test.com + GIT_AUTHOR_NAME: Test + GIT_COMMITTER_EMAIL: test@test.com + GIT_COMMITTER_NAME: Test + NX_E2E_CI_CACHE_KEY: e2e-circleci-<< parameters.os >> + SELECTED_PM: << parameters.pm >> + NX_E2E_RUN_E2E: 'true' + NX_VERBOSE_LOGGING: 'false' + NX_NATIVE_LOGGING: 'false' + NX_PERF_LOGGING: 'false' + steps: + - run: + name: Configure git metadata (needed for lerna smoke tests) + command: | + git config --global user.email test@test.com + git config --global user.name "Test Test" + - run: + name: Set dynamic nx run variable + command: | + echo "export NX_CI_EXECUTION_ENV=\"<< parameters.os >>\";" >> $BASH_ENV + - setup: + os: << parameters.os >> + - run: + name: Agent + command: pnpm nx-cloud start-agent + no_output_timeout: 60m + # ------------------------- # JOBS: Main Linux # ------------------------- @@ -84,21 +165,16 @@ jobs: NX_DAEMON: 'true' NX_PERF_LOGGING: 'false' NX_NATIVE_LOGGING: 'false' - NX_E2E_RUN_E2E: 'true' - NX_CI_EXECUTION_ENV: 'linux' steps: - - checkout - - run: npx nx-cloud@next start-ci-run --stop-agents-after="e2e" - run: + name: Set dynamic nx run variable command: | - sudo apt-get update - sudo apt-get install -y ca-certificates lsof - - browser-tools/install-chrome - - browser-tools/install-chromedriver - - run-pnpm-install: + echo "export NX_CI_EXECUTION_ENV=\"linux\";" >> $BASH_ENV + - setup: os: linux - nx/set-shas: main-branch-name: 'master' + - run: pnpm nx-cloud start-ci-run --stop-agents-after="e2e" - run: name: Check Documentation command: pnpm nx documentation --no-dte @@ -134,28 +210,13 @@ jobs: environment: NX_E2E_CI_CACHE_KEY: e2e-circleci-macos NX_PERF_LOGGING: 'false' - NX_CI_EXECUTION_ENV: 'macos' SELECTED_PM: 'npm' # explicitly define npm for macOS tests steps: - - checkout - - restore_cache: - name: Restore Homebrew packages - keys: - - nrwl-nx-homebrew-packages - run: - name: Configure Detox Environment, Install applesimutils + name: Set dynamic nx run variable command: | - HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null - HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null - xcrun simctl shutdown all && xcrun simctl erase all - no_output_timeout: 20m - - save_cache: - name: Save Homebrew Cache - key: nrwl-nx-homebrew-packages - paths: - - /usr/local/Homebrew - - ~/Library/Caches/Homebrew - - run-pnpm-install: + echo "export NX_CI_EXECUTION_ENV=\"macos\";" >> $BASH_ENV + - setup: os: macos - rust/install - nx/set-shas: @@ -174,6 +235,22 @@ workflows: build: jobs: + - agent: + name: 'agent1' + - agent: + name: 'agent2' + - agent: + name: 'agent3' + - agent: + name: 'agent4' + - agent: + name: 'agent5' + - agent: + name: 'agent6' + - agent: + name: 'agent7' + - agent: + name: 'agent8' - main-linux - mainmacos: name: main-macos-e2e diff --git a/.gitignore b/.gitignore index e28ac7c0f6662..1ec0aa30b1cf3 100644 --- a/.gitignore +++ b/.gitignore @@ -35,19 +35,8 @@ CHANGELOG.md # Local dev files .env .bashrc -.nx *.node # Fix for issue when working on the repo in a dev container -.pnpm-store -.nx/cache - -.cargo/.package-cache -.cargo/bin/ -.cargo/env -.cargo/registry/ -.local/ -.npm/ -.profile -.rustup/ +.pnpm-store \ No newline at end of file diff --git a/.nx/workflows/agents.yaml b/.nx/workflows/agents.yaml deleted file mode 100644 index a70663d9c2076..0000000000000 --- a/.nx/workflows/agents.yaml +++ /dev/null @@ -1,58 +0,0 @@ -parallelism: 8 -env: - CI: 'true' - GIT_AUTHOR_EMAIL: test@test.com - GIT_AUTHOR_NAME: Test - GIT_COMMITTER_EMAIL: test@test.com - GIT_COMMITTER_NAME: Test - NX_E2E_CI_CACHE_KEY: e2e-circleci-linux - NX_VERBOSE_LOGGING: 'false' - NX_DAEMON: 'true' - NX_PERF_LOGGING: 'false' - NX_NATIVE_LOGGING: 'false' - SELECTED_PM: 'pnpm' - NX_E2E_RUN_E2E: 'true' - NPM_CONFIG_PREFIX: '/home/workflows/.npm-global' -steps: - - name: Git Clone - script: | - git init . - git remote add origin $GIT_REPOSITORY_URL - git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +{{nxCommitSha}}:{{nxCommitRef}} - git checkout --progress --force -B {{nxBranch}} {{nxCommitRef}} - - - name: Restore cache - script: | - nxw cache restore {{nxBranch}}-node_modules node_modules - nxw cache restore {{nxBranch}}-cypress ~/.cache/Cypress - nxw cache restore {{nxBranch}}-pnpm-store ~/.pnpm-store - - - name: Install Pnpm - script: | - npm install -g @pnpm/exe@8.3.1 - - - name: Pnpm Install - script: | - pnpm install --frozen-lockfile - - - name: Install Rust - script: | - curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh -s -- -y - source "$HOME/.cargo/env" - rustup toolchain install 1.70.0 - - - name: Configure git metadata (needed for lerna smoke tests) - script: | - git config --global user.email test@test.com - git config --global user.name "Test Test" - - - name: Run Agent - script: | - source "$HOME/.cargo/env" - npx nx-cloud start-agent - - - name: Store to cache - script: | - nxw cache store {{nxBranch}}-node_modules node_modules - nxw cache store {{nxBranch}}-cypress ~/.cache/Cypress - nxw cache store {{nxBranch}}-pnpm-store ~/.pnpm-store diff --git a/e2e/esbuild/src/esbuild.test.ts b/e2e/esbuild/src/esbuild.test.ts index 878094d54403d..f994963b8acae 100644 --- a/e2e/esbuild/src/esbuild.test.ts +++ b/e2e/esbuild/src/esbuild.test.ts @@ -25,7 +25,7 @@ describe('EsBuild Plugin', () => { afterEach(() => cleanupProject()); - xit('should setup and build projects using build', async () => { + it('should setup and build projects using build', async () => { const myPkg = uniq('my-pkg'); runCLI(`generate @nx/js:lib ${myPkg} --bundler=esbuild`); updateFile(`libs/${myPkg}/src/index.ts`, `console.log('Hello');\n`); diff --git a/e2e/nx-misc/src/watch.test.ts b/e2e/nx-misc/src/watch.test.ts index 381b70a8842e9..c38ce31bbc89e 100644 --- a/e2e/nx-misc/src/watch.test.ts +++ b/e2e/nx-misc/src/watch.test.ts @@ -20,7 +20,7 @@ async function writeFileForWatcher(path: string, content: string) { await wait(10); } -xdescribe('Nx Commands', () => { +describe('Nx Commands', () => { let proj1 = uniq('proj1'); let proj2 = uniq('proj2'); let proj3 = uniq('proj3'); @@ -33,7 +33,7 @@ xdescribe('Nx Commands', () => { afterAll(() => cleanupProject()); - xit('should watch for project changes', async () => { + it('should watch for project changes', async () => { const getOutput = await runWatch( `--projects=${proj1} -- echo \\$NX_PROJECT_NAME` ); @@ -46,7 +46,7 @@ xdescribe('Nx Commands', () => { expect(await getOutput()).toEqual([proj1]); }); - xit('should watch for all projects and output the project name', async () => { + it('should watch for all projects and output the project name', async () => { const getOutput = await runWatch(`--all -- echo \\$NX_PROJECT_NAME`); await writeFileForWatcher(`libs/${proj1}/newfile.txt`, 'content'); await writeFileForWatcher(`libs/${proj2}/newfile.txt`, 'content'); diff --git a/e2e/utils/get-env-info.ts b/e2e/utils/get-env-info.ts index 2cbbc405e0b6e..064919eeee4e6 100644 --- a/e2e/utils/get-env-info.ts +++ b/e2e/utils/get-env-info.ts @@ -136,8 +136,7 @@ export function ensureCypressInstallation() { } export function ensurePlaywrightBrowsersInstallation() { - const playwrightInstallArgs = process.env.PLAYWRIGHT_INSTALL_ARGS || ''; - execSync(`npx playwright install ${playwrightInstallArgs}`, { + execSync('npx playwright install --with-deps --force', { stdio: isVerbose() ? 'inherit' : 'pipe', encoding: 'utf-8', cwd: tmpProjPath(), diff --git a/packages/nx/src/native/tests/watcher.spec.ts b/packages/nx/src/native/tests/watcher.spec.ts index d625386b5cbe0..f5d822bf1461c 100644 --- a/packages/nx/src/native/tests/watcher.spec.ts +++ b/packages/nx/src/native/tests/watcher.spec.ts @@ -2,7 +2,7 @@ import { TempFs } from '../../utils/testing/temp-fs'; import { Watcher } from '../index'; import { realpathSync } from 'fs-extra'; -xdescribe('watcher', () => { +describe('watcher', () => { let temp: TempFs; let watcher: Watcher; beforeEach(() => {