diff --git a/packages/nx/src/utils/package-manager.ts b/packages/nx/src/utils/package-manager.ts index 896f568efbb07d..3fcb93fb9c43e5 100644 --- a/packages/nx/src/utils/package-manager.ts +++ b/packages/nx/src/utils/package-manager.ts @@ -82,7 +82,7 @@ export function getPackageManagerCommand( }, pnpm: () => { const pnpmVersion = getPackageManagerVersion('pnpm', root); - const useExec = gte(pnpmVersion, '6.13.0'); + const useExec = gte(pnpmVersion, '6.13.0') && lt(pnpmVersion, '7.0.0'); const includeDoubleDashBeforeArgs = lt(pnpmVersion, '7.0.0'); const isPnpmWorkspace = existsSync(join(root, 'pnpm-workspace.yaml')); diff --git a/packages/workspace/src/generators/ci-workflow/__snapshots__/ci-workflow.spec.ts.snap b/packages/workspace/src/generators/ci-workflow/__snapshots__/ci-workflow.spec.ts.snap index d4ebc7c777702e..f0801d9fdef75e 100644 --- a/packages/workspace/src/generators/ci-workflow/__snapshots__/ci-workflow.spec.ts.snap +++ b/packages/workspace/src/generators/ci-workflow/__snapshots__/ci-workflow.spec.ts.snap @@ -28,8 +28,6 @@ jobs: pool: vmImage: 'ubuntu-latest' steps: - - script: npm install --prefix=$HOME/.local -g pnpm@8.2.0 - displayName: Install PNPM - script: pnpm install --frozen-lockfile displayName: NPM Install Dependencies - script: npx nx-cloud start-agent @@ -40,21 +38,19 @@ jobs: pool: vmImage: 'ubuntu-latest' steps: - - script: npm install --prefix=$HOME/.local -g pnpm@8.2.0 - displayName: Install PNPM - script: pnpm install --frozen-lockfile displayName: NPM Install Dependencies - - script: pnpm exec nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 + - script: pnpx nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 displayName: Start CI run - - script: pnpm exec nx-cloud record -- pnpm exec nx format:check --base=$(BASE_SHA) --head=$(HEAD_SHA) + - script: pnpx nx-cloud record -- pnpx nx format:check --base=$(BASE_SHA) --head=$(HEAD_SHA) displayName: Check format - - script: pnpm exec nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --target=lint --parallel=3 + - script: pnpx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --target=lint --parallel=3 displayName: Run lint - - script: pnpm exec nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --target=test --parallel=3 --ci --code-coverage + - script: pnpx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --target=test --parallel=3 --ci --code-coverage displayName: Run test - - script: pnpm exec nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --target=build --parallel=3 + - script: pnpx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --target=build --parallel=3 displayName: Run build - - script: pnpm exec nx-cloud stop-all-agents + - script: pnpx nx-cloud stop-all-agents condition: always() displayName: Stop all Nx-Cloud agents " @@ -73,10 +69,8 @@ definitions: script: - export NX_BRANCH=$BITBUCKET_PR_ID - - npm install --prefix=$HOME/.local -g pnpm@8.2.0 - - pnpm install --frozen-lockfile - - pnpm exec nx-cloud start-agent + - pnpx nx-cloud start-agent pipelines: pull-requests: @@ -87,13 +81,11 @@ pipelines: script: - export NX_BRANCH=$BITBUCKET_PR_ID - - npm install --prefix=$HOME/.local -g pnpm@8.2.0 - - pnpm install --frozen-lockfile - - pnpm exec nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 - - pnpm exec nx-cloud record -- pnpm exec nx format:check - - pnpm exec nx affected --target=lint & pnpm exec nx affected --target=test & pnpm exec nx affected --target=build - - pnpm exec nx-cloud stop-all-agents + - pnpx nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 + - pnpx nx-cloud record -- pnpx nx format:check + - pnpx nx affected --target=lint & pnpx nx affected --target=test & pnpx nx affected --target=build + - pnpx nx-cloud stop-all-agents - step: *agent - step: *agent - step: *agent @@ -115,16 +107,12 @@ jobs: type: integer steps: - checkout - - - run: - name: Install PNPM - command: npm install --prefix=$HOME/.local -g pnpm@8.2.0 - run: name: Install dependencies command: pnpm install --frozen-lockfile - run: name: Start the agent << parameters.ordinal >> - command: pnpm exec nx-cloud start-agent + command: pnpx nx-cloud start-agent no_output_timeout: 60m main: docker: @@ -133,10 +121,6 @@ jobs: NX_CLOUD_DISTRIBUTED_EXECUTION: 'true' steps: - checkout - - - run: - name: Install PNPM - command: npm install --prefix=$HOME/.local -g pnpm@8.2.0 - run: name: Install dependencies command: pnpm install --frozen-lockfile @@ -144,22 +128,22 @@ jobs: main-branch-name: 'main' - run: name: Initialize the Nx Cloud distributed CI run - command: pnpm exec nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 + command: pnpx nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 - run: name: Check format - command: pnpm exec nx-cloud record -- pnpm exec nx format:check --base=$NX_BASE --head=$NX_HEAD + command: pnpx nx-cloud record -- pnpx nx format:check --base=$NX_BASE --head=$NX_HEAD - run: name: Run lint - command: pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD --target=lint --parallel=3 + command: pnpx nx affected --base=$NX_BASE --head=$NX_HEAD --target=lint --parallel=3 - run: name: Run test - command: pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD --target=test --parallel=3 --ci --code-coverage + command: pnpx nx affected --base=$NX_BASE --head=$NX_HEAD --target=test --parallel=3 --ci --code-coverage - run: name: Run build - command: pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD --target=build --parallel=3 + command: pnpx nx affected --base=$NX_BASE --head=$NX_HEAD --target=build --parallel=3 - run: name: Stop all agents - command: pnpm exec nx-cloud stop-all-agents + command: pnpx nx-cloud stop-all-agents when: always workflows: @@ -194,13 +178,13 @@ jobs: main-branch-name: main number-of-agents: 3 init-commands: | - pnpm exec nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 + pnpx nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 parallel-commands: | - pnpm exec nx-cloud record -- pnpm exec nx format:check + pnpx nx-cloud record -- pnpx nx format:check parallel-commands-on-agents: | - pnpm exec nx affected --target=lint --parallel=3 - pnpm exec nx affected --target=test --parallel=3 --ci --code-coverage - pnpm exec nx affected --target=build --parallel=3 + pnpx nx affected --target=lint --parallel=3 + pnpx nx affected --target=test --parallel=3 --ci --code-coverage + pnpx nx affected --target=build --parallel=3 agents: name: Nx Cloud - Agents @@ -227,13 +211,13 @@ jobs: main-branch-name: main number-of-agents: 3 init-commands: | - pnpm exec nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 + pnpx nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 parallel-commands: | - pnpm exec nx-cloud record -- pnpm exec nx format:check + pnpx nx-cloud record -- pnpx nx format:check parallel-commands-on-agents: | - pnpm exec nx affected --target=lint --parallel=3 - pnpm exec nx affected --target=test --parallel=3 --ci --code-coverage - pnpm exec nx affected --target=build --parallel=3 + pnpx nx affected --target=lint --parallel=3 + pnpx nx affected --target=test --parallel=3 --ci --code-coverage + pnpx nx affected --target=build --parallel=3 agents: name: Nx Cloud - Agents @@ -252,10 +236,8 @@ variables: .dte-agent: interruptible: true script: - - npm install --prefix=$HOME/.local -g pnpm@8.2.0 - - pnpm install --frozen-lockfile - - pnpm exec nx-cloud start-agent + - pnpx nx-cloud start-agent # Creating template for a job running DTE (orchestrator) .base-pipeline: @@ -264,8 +246,6 @@ variables: - main - merge_requests before_script: - - npm install --prefix=$HOME/.local -g pnpm@8.2.0 - - pnpm install --frozen-lockfile - NX_HEAD=$CI_COMMIT_SHA - NX_BASE=\${CI_MERGE_REQUEST_DIFF_BASE_SHA:-$CI_COMMIT_BEFORE_SHA} @@ -275,9 +255,9 @@ CI: stage: affected extends: .base-pipeline script: - - pnpm exec nx-cloud start-ci-run --stop-agents-after="build" - - pnpm exec nx-cloud record -- pnpm exec nx format:check --base=$NX_BASE --head=$NX_HEAD - - pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD --target=lint --parallel=3 & pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD --target=test --parallel=3 --ci --code-coverage & pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD --target=e2e --parallel=3 --ci --code-coverage & pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD --target=build --parallel=3 + - pnpx nx-cloud start-ci-run --stop-agents-after="build" + - pnpx nx-cloud record -- pnpx nx format:check --base=$NX_BASE --head=$NX_HEAD + - pnpx nx affected --base=$NX_BASE --head=$NX_HEAD --target=lint --parallel=3 & pnpx nx affected --base=$NX_BASE --head=$NX_HEAD --target=test --parallel=3 --ci --code-coverage & pnpx nx affected --base=$NX_BASE --head=$NX_HEAD --target=e2e --parallel=3 --ci --code-coverage & pnpx nx affected --base=$NX_BASE --head=$NX_HEAD --target=build --parallel=3 # Create as many agents as you want nx-dte-agent1: @@ -322,8 +302,6 @@ jobs: pool: vmImage: 'ubuntu-latest' steps: - - script: npm install --prefix=$HOME/.local -g pnpm@8.2.0 - displayName: Install PNPM - script: pnpm install --frozen-lockfile displayName: NPM Install Dependencies - script: npx nx-cloud start-agent @@ -334,21 +312,19 @@ jobs: pool: vmImage: 'ubuntu-latest' steps: - - script: npm install --prefix=$HOME/.local -g pnpm@8.2.0 - displayName: Install PNPM - script: pnpm install --frozen-lockfile displayName: NPM Install Dependencies - - script: pnpm exec nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 + - script: pnpx nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 displayName: Start CI run - - script: pnpm exec nx-cloud record -- pnpm exec nx format:check --base=$(BASE_SHA) --head=$(HEAD_SHA) + - script: pnpx nx-cloud record -- pnpx nx format:check --base=$(BASE_SHA) --head=$(HEAD_SHA) displayName: Check format - - script: pnpm exec nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --target=lint --parallel=3 + - script: pnpx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --target=lint --parallel=3 displayName: Run lint - - script: pnpm exec nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --target=test --parallel=3 --ci --code-coverage + - script: pnpx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --target=test --parallel=3 --ci --code-coverage displayName: Run test - - script: pnpm exec nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --target=build --parallel=3 + - script: pnpx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --target=build --parallel=3 displayName: Run build - - script: pnpm exec nx-cloud stop-all-agents + - script: pnpx nx-cloud stop-all-agents condition: always() displayName: Stop all Nx-Cloud agents " @@ -367,10 +343,8 @@ definitions: script: - export NX_BRANCH=$BITBUCKET_PR_ID - - npm install --prefix=$HOME/.local -g pnpm@8.2.0 - - pnpm install --frozen-lockfile - - pnpm exec nx-cloud start-agent + - pnpx nx-cloud start-agent pipelines: pull-requests: @@ -381,13 +355,11 @@ pipelines: script: - export NX_BRANCH=$BITBUCKET_PR_ID - - npm install --prefix=$HOME/.local -g pnpm@8.2.0 - - pnpm install --frozen-lockfile - - pnpm exec nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 - - pnpm exec nx-cloud record -- pnpm exec nx format:check - - pnpm exec nx affected --target=lint & pnpm exec nx affected --target=test & pnpm exec nx affected --target=build - - pnpm exec nx-cloud stop-all-agents + - pnpx nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 + - pnpx nx-cloud record -- pnpx nx format:check + - pnpx nx affected --target=lint & pnpx nx affected --target=test & pnpx nx affected --target=build + - pnpx nx-cloud stop-all-agents - step: *agent - step: *agent - step: *agent @@ -409,16 +381,12 @@ jobs: type: integer steps: - checkout - - - run: - name: Install PNPM - command: npm install --prefix=$HOME/.local -g pnpm@8.2.0 - run: name: Install dependencies command: pnpm install --frozen-lockfile - run: name: Start the agent << parameters.ordinal >> - command: pnpm exec nx-cloud start-agent + command: pnpx nx-cloud start-agent no_output_timeout: 60m main: docker: @@ -427,10 +395,6 @@ jobs: NX_CLOUD_DISTRIBUTED_EXECUTION: 'true' steps: - checkout - - - run: - name: Install PNPM - command: npm install --prefix=$HOME/.local -g pnpm@8.2.0 - run: name: Install dependencies command: pnpm install --frozen-lockfile @@ -438,22 +402,22 @@ jobs: main-branch-name: 'main' - run: name: Initialize the Nx Cloud distributed CI run - command: pnpm exec nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 + command: pnpx nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 - run: name: Check format - command: pnpm exec nx-cloud record -- pnpm exec nx format:check --base=$NX_BASE --head=$NX_HEAD + command: pnpx nx-cloud record -- pnpx nx format:check --base=$NX_BASE --head=$NX_HEAD - run: name: Run lint - command: pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD --target=lint --parallel=3 + command: pnpx nx affected --base=$NX_BASE --head=$NX_HEAD --target=lint --parallel=3 - run: name: Run test - command: pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD --target=test --parallel=3 --ci --code-coverage + command: pnpx nx affected --base=$NX_BASE --head=$NX_HEAD --target=test --parallel=3 --ci --code-coverage - run: name: Run build - command: pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD --target=build --parallel=3 + command: pnpx nx affected --base=$NX_BASE --head=$NX_HEAD --target=build --parallel=3 - run: name: Stop all agents - command: pnpm exec nx-cloud stop-all-agents + command: pnpx nx-cloud stop-all-agents when: always workflows: @@ -488,13 +452,13 @@ jobs: main-branch-name: main number-of-agents: 3 init-commands: | - pnpm exec nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 + pnpx nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 parallel-commands: | - pnpm exec nx-cloud record -- pnpm exec nx format:check + pnpx nx-cloud record -- pnpx nx format:check parallel-commands-on-agents: | - pnpm exec nx affected --target=lint --parallel=3 - pnpm exec nx affected --target=test --parallel=3 --ci --code-coverage - pnpm exec nx affected --target=build --parallel=3 + pnpx nx affected --target=lint --parallel=3 + pnpx nx affected --target=test --parallel=3 --ci --code-coverage + pnpx nx affected --target=build --parallel=3 agents: name: Nx Cloud - Agents @@ -521,13 +485,13 @@ jobs: main-branch-name: main number-of-agents: 3 init-commands: | - pnpm exec nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 + pnpx nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 parallel-commands: | - pnpm exec nx-cloud record -- pnpm exec nx format:check + pnpx nx-cloud record -- pnpx nx format:check parallel-commands-on-agents: | - pnpm exec nx affected --target=lint --parallel=3 - pnpm exec nx affected --target=test --parallel=3 --ci --code-coverage - pnpm exec nx affected --target=build --parallel=3 + pnpx nx affected --target=lint --parallel=3 + pnpx nx affected --target=test --parallel=3 --ci --code-coverage + pnpx nx affected --target=build --parallel=3 agents: name: Nx Cloud - Agents @@ -546,10 +510,8 @@ variables: .dte-agent: interruptible: true script: - - npm install --prefix=$HOME/.local -g pnpm@8.2.0 - - pnpm install --frozen-lockfile - - pnpm exec nx-cloud start-agent + - pnpx nx-cloud start-agent # Creating template for a job running DTE (orchestrator) .base-pipeline: @@ -558,8 +520,6 @@ variables: - main - merge_requests before_script: - - npm install --prefix=$HOME/.local -g pnpm@8.2.0 - - pnpm install --frozen-lockfile - NX_HEAD=$CI_COMMIT_SHA - NX_BASE=\${CI_MERGE_REQUEST_DIFF_BASE_SHA:-$CI_COMMIT_BEFORE_SHA} @@ -569,9 +529,9 @@ CI: stage: affected extends: .base-pipeline script: - - pnpm exec nx-cloud start-ci-run --stop-agents-after="build" - - pnpm exec nx-cloud record -- pnpm exec nx format:check --base=$NX_BASE --head=$NX_HEAD - - pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD --target=lint --parallel=3 & pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD --target=test --parallel=3 --ci --code-coverage & pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD --target=e2e --parallel=3 --ci --code-coverage & pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD --target=build --parallel=3 + - pnpx nx-cloud start-ci-run --stop-agents-after="build" + - pnpx nx-cloud record -- pnpx nx format:check --base=$NX_BASE --head=$NX_HEAD + - pnpx nx affected --base=$NX_BASE --head=$NX_HEAD --target=lint --parallel=3 & pnpx nx affected --base=$NX_BASE --head=$NX_HEAD --target=test --parallel=3 --ci --code-coverage & pnpx nx affected --base=$NX_BASE --head=$NX_HEAD --target=e2e --parallel=3 --ci --code-coverage & pnpx nx affected --base=$NX_BASE --head=$NX_HEAD --target=build --parallel=3 # Create as many agents as you want nx-dte-agent1: @@ -616,8 +576,6 @@ jobs: pool: vmImage: 'ubuntu-latest' steps: - - script: npm install --prefix=$HOME/.local -g pnpm@8.2.0 - displayName: Install PNPM - script: pnpm install --frozen-lockfile displayName: NPM Install Dependencies - script: npx nx-cloud start-agent @@ -628,21 +586,19 @@ jobs: pool: vmImage: 'ubuntu-latest' steps: - - script: npm install --prefix=$HOME/.local -g pnpm@8.2.0 - displayName: Install PNPM - script: pnpm install --frozen-lockfile displayName: NPM Install Dependencies - - script: pnpm exec nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 + - script: pnpx nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 displayName: Start CI run - - script: pnpm exec nx-cloud record -- pnpm exec nx format:check --base=$(BASE_SHA) --head=$(HEAD_SHA) + - script: pnpx nx-cloud record -- pnpx nx format:check --base=$(BASE_SHA) --head=$(HEAD_SHA) displayName: Check format - - script: pnpm exec nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --target=lint --parallel=3 + - script: pnpx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --target=lint --parallel=3 displayName: Run lint - - script: pnpm exec nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --target=test --parallel=3 --ci --code-coverage + - script: pnpx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --target=test --parallel=3 --ci --code-coverage displayName: Run test - - script: pnpm exec nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --target=build --parallel=3 + - script: pnpx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --target=build --parallel=3 displayName: Run build - - script: pnpm exec nx-cloud stop-all-agents + - script: pnpx nx-cloud stop-all-agents condition: always() displayName: Stop all Nx-Cloud agents " @@ -661,10 +617,8 @@ definitions: script: - export NX_BRANCH=$BITBUCKET_PR_ID - - npm install --prefix=$HOME/.local -g pnpm@8.2.0 - - pnpm install --frozen-lockfile - - pnpm exec nx-cloud start-agent + - pnpx nx-cloud start-agent pipelines: pull-requests: @@ -675,13 +629,11 @@ pipelines: script: - export NX_BRANCH=$BITBUCKET_PR_ID - - npm install --prefix=$HOME/.local -g pnpm@8.2.0 - - pnpm install --frozen-lockfile - - pnpm exec nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 - - pnpm exec nx-cloud record -- pnpm exec nx format:check - - pnpm exec nx affected --target=lint & pnpm exec nx affected --target=test & pnpm exec nx affected --target=build - - pnpm exec nx-cloud stop-all-agents + - pnpx nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 + - pnpx nx-cloud record -- pnpx nx format:check + - pnpx nx affected --target=lint & pnpx nx affected --target=test & pnpx nx affected --target=build + - pnpx nx-cloud stop-all-agents - step: *agent - step: *agent - step: *agent @@ -703,16 +655,12 @@ jobs: type: integer steps: - checkout - - - run: - name: Install PNPM - command: npm install --prefix=$HOME/.local -g pnpm@8.2.0 - run: name: Install dependencies command: pnpm install --frozen-lockfile - run: name: Start the agent << parameters.ordinal >> - command: pnpm exec nx-cloud start-agent + command: pnpx nx-cloud start-agent no_output_timeout: 60m main: docker: @@ -721,10 +669,6 @@ jobs: NX_CLOUD_DISTRIBUTED_EXECUTION: 'true' steps: - checkout - - - run: - name: Install PNPM - command: npm install --prefix=$HOME/.local -g pnpm@8.2.0 - run: name: Install dependencies command: pnpm install --frozen-lockfile @@ -732,22 +676,22 @@ jobs: main-branch-name: 'main' - run: name: Initialize the Nx Cloud distributed CI run - command: pnpm exec nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 + command: pnpx nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 - run: name: Check format - command: pnpm exec nx-cloud record -- pnpm exec nx format:check --base=$NX_BASE --head=$NX_HEAD + command: pnpx nx-cloud record -- pnpx nx format:check --base=$NX_BASE --head=$NX_HEAD - run: name: Run lint - command: pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD --target=lint --parallel=3 + command: pnpx nx affected --base=$NX_BASE --head=$NX_HEAD --target=lint --parallel=3 - run: name: Run test - command: pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD --target=test --parallel=3 --ci --code-coverage + command: pnpx nx affected --base=$NX_BASE --head=$NX_HEAD --target=test --parallel=3 --ci --code-coverage - run: name: Run build - command: pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD --target=build --parallel=3 + command: pnpx nx affected --base=$NX_BASE --head=$NX_HEAD --target=build --parallel=3 - run: name: Stop all agents - command: pnpm exec nx-cloud stop-all-agents + command: pnpx nx-cloud stop-all-agents when: always workflows: @@ -782,13 +726,13 @@ jobs: main-branch-name: main number-of-agents: 3 init-commands: | - pnpm exec nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 + pnpx nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 parallel-commands: | - pnpm exec nx-cloud record -- pnpm exec nx format:check + pnpx nx-cloud record -- pnpx nx format:check parallel-commands-on-agents: | - pnpm exec nx affected --target=lint --parallel=3 - pnpm exec nx affected --target=test --parallel=3 --ci --code-coverage - pnpm exec nx affected --target=build --parallel=3 + pnpx nx affected --target=lint --parallel=3 + pnpx nx affected --target=test --parallel=3 --ci --code-coverage + pnpx nx affected --target=build --parallel=3 agents: name: Nx Cloud - Agents @@ -815,13 +759,13 @@ jobs: main-branch-name: main number-of-agents: 3 init-commands: | - pnpm exec nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 + pnpx nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 parallel-commands: | - pnpm exec nx-cloud record -- pnpm exec nx format:check + pnpx nx-cloud record -- pnpx nx format:check parallel-commands-on-agents: | - pnpm exec nx affected --target=lint --parallel=3 - pnpm exec nx affected --target=test --parallel=3 --ci --code-coverage - pnpm exec nx affected --target=build --parallel=3 + pnpx nx affected --target=lint --parallel=3 + pnpx nx affected --target=test --parallel=3 --ci --code-coverage + pnpx nx affected --target=build --parallel=3 agents: name: Nx Cloud - Agents @@ -840,10 +784,8 @@ variables: .dte-agent: interruptible: true script: - - npm install --prefix=$HOME/.local -g pnpm@8.2.0 - - pnpm install --frozen-lockfile - - pnpm exec nx-cloud start-agent + - pnpx nx-cloud start-agent # Creating template for a job running DTE (orchestrator) .base-pipeline: @@ -852,8 +794,6 @@ variables: - main - merge_requests before_script: - - npm install --prefix=$HOME/.local -g pnpm@8.2.0 - - pnpm install --frozen-lockfile - NX_HEAD=$CI_COMMIT_SHA - NX_BASE=\${CI_MERGE_REQUEST_DIFF_BASE_SHA:-$CI_COMMIT_BEFORE_SHA} @@ -863,9 +803,9 @@ CI: stage: affected extends: .base-pipeline script: - - pnpm exec nx-cloud start-ci-run --stop-agents-after="build" - - pnpm exec nx-cloud record -- pnpm exec nx format:check --base=$NX_BASE --head=$NX_HEAD - - pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD --target=lint --parallel=3 & pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD --target=test --parallel=3 --ci --code-coverage & pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD --target=e2e --parallel=3 --ci --code-coverage & pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD --target=build --parallel=3 + - pnpx nx-cloud start-ci-run --stop-agents-after="build" + - pnpx nx-cloud record -- pnpx nx format:check --base=$NX_BASE --head=$NX_HEAD + - pnpx nx affected --base=$NX_BASE --head=$NX_HEAD --target=lint --parallel=3 & pnpx nx affected --base=$NX_BASE --head=$NX_HEAD --target=test --parallel=3 --ci --code-coverage & pnpx nx affected --base=$NX_BASE --head=$NX_HEAD --target=e2e --parallel=3 --ci --code-coverage & pnpx nx affected --base=$NX_BASE --head=$NX_HEAD --target=build --parallel=3 # Create as many agents as you want nx-dte-agent1: