diff --git a/docs/nx-cloud/tutorial/circle.md b/docs/nx-cloud/tutorial/circle.md index 7cb39022d9..f1402be6f3 100644 --- a/docs/nx-cloud/tutorial/circle.md +++ b/docs/nx-cloud/tutorial/circle.md @@ -102,7 +102,7 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" - run: pnpm install --frozen-lockfile @@ -252,7 +252,7 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution - run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" - run: pnpm install --frozen-lockfile diff --git a/docs/nx-cloud/tutorial/github-actions.md b/docs/nx-cloud/tutorial/github-actions.md index 421bea2493..dd3a0d3bfb 100644 --- a/docs/nx-cloud/tutorial/github-actions.md +++ b/docs/nx-cloud/tutorial/github-actions.md @@ -80,7 +80,7 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" - uses: actions/setup-node@v3 @@ -215,7 +215,7 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Uncomment this line to enable task distribution - run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" - uses: actions/setup-node@v3 diff --git a/docs/shared/tutorials/angular-monorepo.md b/docs/shared/tutorials/angular-monorepo.md index ef57539c1e..8ce44f6fb8 100644 --- a/docs/shared/tutorials/angular-monorepo.md +++ b/docs/shared/tutorials/angular-monorepo.md @@ -1275,7 +1275,7 @@ Once you click the link, follow the steps provided and make sure Nx Cloud is ena ### Configure Your CI Workflow {% highlightColor="green" %} -When you chose GitHub Actions as your CI provider at the beginning of the tutorial, `create-nx-workspace` created a `.github/workflows/ci.yml` file that contains a CI pipeline that will run the `lint`, `test`, `build` and `e2e` tasks for projects that are affected by any given PR. Since we are using Nx Cloud, the pipeline will also distribute tasks across multiple machines to ensure fast and reliable CI runs. +When you chose GitHub Actions as your CI provider at the beginning of the tutorial, `create-nx-workspace` created a `.github/workflows/ci.yml` file that contains a CI pipeline that will run the `lint`, `test`, `build` and `e2e` tasks for projects that are affected by any given PR. If you would like to also distribute tasks across multiple machines to ensure fast and reliable CI runs, uncomment the `nx-cloud start-ci-run` line. If you need to generate a new workflow file for GitHub Actions or other providers, you can do so with this command: @@ -1298,8 +1298,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this - - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - uses: actions/setup-node@v3 with: node-version: 20 diff --git a/docs/shared/tutorials/angular-standalone.md b/docs/shared/tutorials/angular-standalone.md index fffd7d11f5..5b930e94c9 100644 --- a/docs/shared/tutorials/angular-standalone.md +++ b/docs/shared/tutorials/angular-standalone.md @@ -1075,7 +1075,7 @@ Once you click the link, follow the steps provided and make sure Nx Cloud is ena ### Configure Your CI Workflow {% highlightColor="green" %} -When you chose GitHub Actions as your CI provider at the beginning of the tutorial, `create-nx-workspace` created a `.github/workflows/ci.yml` file that contains a CI pipeline that will run the `lint`, `test`, `build` and `e2e` tasks for projects that are affected by any given PR. Since we are using Nx Cloud, the pipeline will also distribute tasks across multiple machines to ensure fast and reliable CI runs. +When you chose GitHub Actions as your CI provider at the beginning of the tutorial, `create-nx-workspace` created a `.github/workflows/ci.yml` file that contains a CI pipeline that will run the `lint`, `test`, `build` and `e2e` tasks for projects that are affected by any given PR. If you would like to also distribute tasks across multiple machines to ensure fast and reliable CI runs, uncomment the `nx-cloud start-ci-run` line. If you need to generate a new workflow file for GitHub Actions or other providers, you can do so with this command: @@ -1098,8 +1098,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this - - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - uses: actions/setup-node@v3 with: node-version: 20 diff --git a/docs/shared/tutorials/gradle.md b/docs/shared/tutorials/gradle.md index 5c0223f523..b0726592a6 100644 --- a/docs/shared/tutorials/gradle.md +++ b/docs/shared/tutorials/gradle.md @@ -326,7 +326,7 @@ And use the following command to generate a CI workflow file. ./nx generate ci-workflow --ci=github ``` -This generator creates a `.github/workflows/ci.yml` file that contains a CI pipeline that will run the `lint`, `test`, `build` and `e2e` tasks for projects that are affected by any given PR. Since we are using Nx Cloud, the pipeline will also distribute tasks across multiple machines to ensure fast and reliable CI runs. +This generator creates a `.github/workflows/ci.yml` file that contains a CI pipeline that will run the `lint`, `test`, `build` and `e2e` tasks for projects that are affected by any given PR. If you would like to also distribute tasks across multiple machines to ensure fast and reliable CI runs, uncomment the `nx-cloud start-ci-run` line. The key lines in the CI pipeline are: @@ -354,7 +354,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-jvm" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-jvm" --stop-agents-after="build" - name: Set up JDK 17 for x64 uses: actions/setup-java@v4 diff --git a/docs/shared/tutorials/npm-workspaces.md b/docs/shared/tutorials/npm-workspaces.md index 26595c0e96..b2c88e2d71 100644 --- a/docs/shared/tutorials/npm-workspaces.md +++ b/docs/shared/tutorials/npm-workspaces.md @@ -440,7 +440,7 @@ Use the following command to generate a CI workflow file. npx nx generate ci-workflow --ci=github ``` -This generator creates a `.github/workflows/ci.yml` file that contains a CI pipeline that will run the `lint`, `test`, `build` and `e2e` tasks for projects that are affected by any given PR. Since we are using Nx Cloud, the pipeline will also [distribute tasks across multiple machines](/ci/features/distribute-task-execution) to ensure fast and reliable CI runs. +This generator creates a `.github/workflows/ci.yml` file that contains a CI pipeline that will run the `lint`, `test`, `build` and `e2e` tasks for projects that are affected by any given PR. If you would like to also distribute tasks across multiple machines to ensure fast and reliable CI runs, uncomment the `nx-cloud start-ci-run` line. The key lines in the CI pipeline are: @@ -457,8 +457,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this - - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - uses: actions/setup-node@v3 with: node-version: 20 diff --git a/docs/shared/tutorials/react-monorepo.md b/docs/shared/tutorials/react-monorepo.md index 6549b9777c..87c59f1d75 100644 --- a/docs/shared/tutorials/react-monorepo.md +++ b/docs/shared/tutorials/react-monorepo.md @@ -1078,7 +1078,7 @@ Once you click the link, follow the steps provided and make sure Nx Cloud is ena ### Configure Your CI Workflow {% highlightColor="green" %} -When you chose GitHub Actions as your CI provider at the beginning of the tutorial, `create-nx-workspace` created a `.github/workflows/ci.yml` file that contains a CI pipeline that will run the `lint`, `test`, `build` and `e2e` tasks for projects that are affected by any given PR. Since we are using Nx Cloud, the pipeline will also distribute tasks across multiple machines to ensure fast and reliable CI runs. +When you chose GitHub Actions as your CI provider at the beginning of the tutorial, `create-nx-workspace` created a `.github/workflows/ci.yml` file that contains a CI pipeline that will run the `lint`, `test`, `build` and `e2e` tasks for projects that are affected by any given PR. If you would like to also distribute tasks across multiple machines to ensure fast and reliable CI runs, uncomment the `nx-cloud start-ci-run` line. If you need to generate a new workflow file for GitHub Actions or other providers, you can do so with this command: @@ -1101,8 +1101,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this - - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - uses: actions/setup-node@v3 with: node-version: 20 diff --git a/docs/shared/tutorials/react-standalone.md b/docs/shared/tutorials/react-standalone.md index 6bba11840e..a429c73e80 100644 --- a/docs/shared/tutorials/react-standalone.md +++ b/docs/shared/tutorials/react-standalone.md @@ -1033,7 +1033,7 @@ Use the following command to generate a CI workflow file. npx nx generate ci-workflow --ci=github ``` -This generator creates a `.github/workflows/ci.yml` file that contains a CI pipeline that will run the `lint`, `test`, `build` and `e2e` tasks for projects that are affected by any given PR. Since we are using Nx Cloud, the pipeline will also distribute tasks across multiple machines to ensure fast and reliable CI runs. +This generator creates a `.github/workflows/ci.yml` file that contains a CI pipeline that will run the `lint`, `test`, `build` and `e2e` tasks for projects that are affected by any given PR. If you would like to also distribute tasks across multiple machines to ensure fast and reliable CI runs, uncomment the `nx-cloud start-ci-run` line. The key lines in the CI pipeline are: diff --git a/docs/shared/tutorials/vue-standalone.md b/docs/shared/tutorials/vue-standalone.md index ee6da9f81a..46ad2b274d 100644 --- a/docs/shared/tutorials/vue-standalone.md +++ b/docs/shared/tutorials/vue-standalone.md @@ -1081,7 +1081,7 @@ Use the following command to generate a CI workflow file. npx nx generate ci-workflow --ci=github ``` -This generator creates a `.github/workflows/ci.yml` file that contains a CI pipeline that will run the `lint`, `test`, `build` and `e2e` tasks for projects that are affected by any given PR. Since we are using Nx Cloud, the pipeline will also distribute tasks across multiple machines to ensure fast and reliable CI runs. +This generator creates a `.github/workflows/ci.yml` file that contains a CI pipeline that will run the `lint`, `test`, `build` and `e2e` tasks for projects that are affected by any given PR. If you would like to also distribute tasks across multiple machines to ensure fast and reliable CI runs, uncomment the `nx-cloud start-ci-run` line. The key lines in the CI pipeline are: @@ -1098,8 +1098,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this - - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - uses: actions/setup-node@v3 with: node-version: 20 diff --git a/packages/gradle/src/generators/ci-workflow/__snapshots__/generator.spec.ts.snap b/packages/gradle/src/generators/ci-workflow/__snapshots__/generator.spec.ts.snap index 6e00754488..373433f58f 100644 --- a/packages/gradle/src/generators/ci-workflow/__snapshots__/generator.spec.ts.snap +++ b/packages/gradle/src/generators/ci-workflow/__snapshots__/generator.spec.ts.snap @@ -20,7 +20,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-jvm" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-jvm" --stop-agents-after="build" - nx/set-shas: main-branch-name: 'main' @@ -61,7 +62,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-jvm" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-jvm" --stop-agents-after="build" - name: Set up JDK 17 for x64 uses: actions/setup-java@v4 @@ -100,7 +102,7 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-jvm" --stop-agents-after="build" - nx/set-shas: @@ -142,7 +144,7 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-jvm" --stop-agents-after="build" - name: Set up JDK 17 for x64 diff --git a/packages/gradle/src/generators/ci-workflow/files/circleci/.circleci/config.yml.template b/packages/gradle/src/generators/ci-workflow/files/circleci/.circleci/config.yml.template index f66de66d7a..39828ee160 100644 --- a/packages/gradle/src/generators/ci-workflow/files/circleci/.circleci/config.yml.template +++ b/packages/gradle/src/generators/ci-workflow/files/circleci/.circleci/config.yml.template @@ -17,10 +17,9 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - <% if (connectedToCloud) { %>- run: <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="3 linux-medium-jvm" --stop-agents-after="build" - <% } else { %># Connect your workspace by running "nx connect" and uncomment this + <% if (connectedToCloud) { %># Uncomment this line to enable task distribution<% } else { %># Connect your workspace by running "nx connect" and uncomment this line to enable task distribution<% } %> # - run: <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="3 linux-medium-jvm" --stop-agents-after="build" - <% } %> + - nx/set-shas: main-branch-name: '<%= mainBranch %>' diff --git a/packages/gradle/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml.template b/packages/gradle/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml.template index 38d9a806ac..11065638f1 100644 --- a/packages/gradle/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml.template +++ b/packages/gradle/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml.template @@ -21,10 +21,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - <% if (connectedToCloud) { %>- run: <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="3 linux-medium-jvm" --stop-agents-after="build" - <% } else { %># Connect your workspace by running "nx connect" and uncomment this + <% if (connectedToCloud) { %># Uncomment this line to enable task distribution<% } else { %># Connect your workspace by running "nx connect" and uncomment this line to enable task distribution<% } %> # - run: <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="3 linux-medium-jvm" --stop-agents-after="build" - <% } %> - name: Set up JDK 17 for x64 uses: actions/setup-java@v4 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 e66dc26f8e..0a19a034e9 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 @@ -47,9 +47,11 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - script: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" + # Uncomment this line to enable task distribution + # - script: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" - script: npm ci --legacy-peer-deps + - script: npx cypress install - script: git branch --track main origin/main condition: eq(variables['Build.Reason'], 'PullRequest') @@ -77,9 +79,11 @@ pipelines: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" + # Uncomment this line to enable task distribution + # - npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" - npm ci --legacy-peer-deps + - npx cypress install # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # npx nx-cloud record -- echo Hello World @@ -123,9 +127,11 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" + # Uncomment this line to enable task distribution + # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" - run: npm ci --legacy-peer-deps + - run: npx cypress install - nx/set-shas: main-branch-name: 'main' @@ -167,7 +173,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" + # Uncomment this line to enable task distribution + # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" # Cache node_modules - uses: actions/setup-node@v4 @@ -176,6 +183,7 @@ jobs: cache: 'npm' - run: npm ci --legacy-peer-deps + - run: npx cypress install - uses: nrwl/nx-set-shas@v4 # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud @@ -209,7 +217,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" + # Uncomment this line to enable task distribution + # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" # Cache node_modules - uses: actions/setup-node@v4 @@ -218,6 +227,7 @@ jobs: cache: 'npm' - run: npm ci --legacy-peer-deps + - run: npx cypress install - uses: nrwl/nx-set-shas@v4 # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud @@ -277,7 +287,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - script: bunx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - script: bunx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - script: bun install --no-cache - script: git branch --track main origin/main @@ -309,7 +320,8 @@ pipelines: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - bunx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - bunx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - bun install --no-cache @@ -360,7 +372,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - run: bunx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - run: bunx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - run: bun install --no-cache - nx/set-shas: @@ -408,7 +421,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - run: bunx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - run: bunx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - run: bun install --no-cache - uses: nrwl/nx-set-shas@v4 @@ -448,7 +462,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - run: bunx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - run: bunx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - run: bun install --no-cache - uses: nrwl/nx-set-shas@v4 @@ -477,7 +492,8 @@ CI: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - bunx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - bunx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - bun install --no-cache - NX_HEAD=$CI_COMMIT_SHA @@ -537,7 +553,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - script: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - script: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - script: npm ci --legacy-peer-deps - script: git branch --track main origin/main @@ -567,7 +584,8 @@ pipelines: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - npm ci --legacy-peer-deps @@ -612,7 +630,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - run: npm ci --legacy-peer-deps - nx/set-shas: @@ -656,7 +675,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules - uses: actions/setup-node@v4 @@ -698,7 +718,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules - uses: actions/setup-node@v4 @@ -731,7 +752,8 @@ CI: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - npm ci --legacy-peer-deps - NX_HEAD=$CI_COMMIT_SHA @@ -794,7 +816,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - script: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - script: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - script: pnpm install --frozen-lockfile - script: git branch --track main origin/main @@ -826,7 +849,8 @@ pipelines: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - pnpm install --frozen-lockfile @@ -877,7 +901,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - run: pnpm install --frozen-lockfile - nx/set-shas: @@ -925,7 +950,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules - uses: actions/setup-node@v4 @@ -971,7 +997,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules - uses: actions/setup-node@v4 @@ -1006,7 +1033,8 @@ CI: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - pnpm install --frozen-lockfile - NX_HEAD=$CI_COMMIT_SHA @@ -1066,7 +1094,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - script: yarn nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - script: yarn nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - script: yarn install --frozen-lockfile - script: git branch --track main origin/main @@ -1096,7 +1125,8 @@ pipelines: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - yarn nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - yarn nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - yarn install --frozen-lockfile @@ -1141,7 +1171,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - run: yarn nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - run: yarn nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - run: yarn install --frozen-lockfile - nx/set-shas: @@ -1185,7 +1216,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - run: yarn nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - run: yarn nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules - uses: actions/setup-node@v4 @@ -1227,7 +1259,8 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - run: yarn nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - run: yarn nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules - uses: actions/setup-node@v4 @@ -1260,7 +1293,8 @@ CI: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - - yarn nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # Uncomment this line to enable task distribution + # - yarn nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - yarn install --frozen-lockfile - NX_HEAD=$CI_COMMIT_SHA @@ -1320,10 +1354,11 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - script: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" - script: npm ci --legacy-peer-deps + - script: npx cypress install - script: git branch --track main origin/main condition: eq(variables['Build.Reason'], 'PullRequest') @@ -1351,10 +1386,11 @@ pipelines: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" - npm ci --legacy-peer-deps + - npx cypress install # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # npx nx-cloud record -- echo Hello World @@ -1399,10 +1435,11 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" - run: npm ci --legacy-peer-deps + - run: npx cypress install - nx/set-shas: main-branch-name: 'main' @@ -1444,7 +1481,7 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" # Cache node_modules @@ -1454,6 +1491,7 @@ jobs: cache: 'npm' - run: npm ci --legacy-peer-deps + - run: npx cypress install - uses: nrwl/nx-set-shas@v4 # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud @@ -1487,7 +1525,7 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" # Cache node_modules @@ -1497,6 +1535,7 @@ jobs: cache: 'npm' - run: npm ci --legacy-peer-deps + - run: npx cypress install - uses: nrwl/nx-set-shas@v4 # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud @@ -1556,7 +1595,7 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - script: bunx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - script: bun install --no-cache @@ -1589,7 +1628,7 @@ pipelines: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - bunx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - bun install --no-cache @@ -1642,7 +1681,7 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - run: bunx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - run: bun install --no-cache @@ -1691,7 +1730,7 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - run: bunx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - run: bun install --no-cache @@ -1732,7 +1771,7 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - run: bunx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - run: bun install --no-cache @@ -1762,7 +1801,7 @@ CI: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - bunx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - bun install --no-cache @@ -1823,7 +1862,7 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - script: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - script: npm ci --legacy-peer-deps @@ -1854,7 +1893,7 @@ pipelines: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - npm ci --legacy-peer-deps @@ -1901,7 +1940,7 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - run: npm ci --legacy-peer-deps @@ -1946,7 +1985,7 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules @@ -1989,7 +2028,7 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules @@ -2023,7 +2062,7 @@ CI: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - npm ci --legacy-peer-deps @@ -2087,7 +2126,7 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - script: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - script: pnpm install --frozen-lockfile @@ -2120,7 +2159,7 @@ pipelines: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - pnpm install --frozen-lockfile @@ -2173,7 +2212,7 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - run: pnpm install --frozen-lockfile @@ -2222,7 +2261,7 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules @@ -2269,7 +2308,7 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules @@ -2305,7 +2344,7 @@ CI: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - pnpm install --frozen-lockfile @@ -2366,7 +2405,7 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - script: yarn nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - script: yarn install --frozen-lockfile @@ -2397,7 +2436,7 @@ pipelines: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - yarn nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - yarn install --frozen-lockfile @@ -2444,7 +2483,7 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - run: yarn nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - run: yarn install --frozen-lockfile @@ -2489,7 +2528,7 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - run: yarn nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules @@ -2532,7 +2571,7 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - run: yarn nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules @@ -2566,7 +2605,7 @@ CI: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - # Connect your workspace by running "nx connect" and uncomment this + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution # - yarn nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" - yarn install --frozen-lockfile diff --git a/packages/workspace/src/generators/ci-workflow/ci-workflow.ts b/packages/workspace/src/generators/ci-workflow/ci-workflow.ts index 7c05499702..c2676a7a18 100644 --- a/packages/workspace/src/generators/ci-workflow/ci-workflow.ts +++ b/packages/workspace/src/generators/ci-workflow/ci-workflow.ts @@ -45,7 +45,9 @@ interface Substitutes { packageManagerPrefix: string; packageManagerPreInstallPrefix: string; nxCloudHost: string; + hasCypress: boolean; hasE2E: boolean; + hasPlaywright: boolean; tmpl: ''; connectedToCloud: boolean; } @@ -73,8 +75,9 @@ function normalizeOptions(options: Schema, tree: Tree): Substitutes { ...packageJson.devDependencies, }; - const hasE2E = - allDependencies['@nx/cypress'] || allDependencies['@nx/playwright']; + const hasCypress = allDependencies['@nx/cypress']; + const hasPlaywright = allDependencies['@nx/playwright']; + const hasE2E = hasCypress || hasPlaywright; const connectedToCloud = isNxCloudUsed(readJson(tree, 'nx.json')); @@ -86,7 +89,9 @@ function normalizeOptions(options: Schema, tree: Tree): Substitutes { packageManagerPrefix, packageManagerPreInstallPrefix, mainBranch: deduceDefaultBase(), + hasCypress, hasE2E, + hasPlaywright, nxCloudHost, tmpl: '', connectedToCloud, diff --git a/packages/workspace/src/generators/ci-workflow/files/azure/azure-pipelines.yml__tmpl__ b/packages/workspace/src/generators/ci-workflow/files/azure/azure-pipelines.yml__tmpl__ index 0321534933..119c396048 100644 --- a/packages/workspace/src/generators/ci-workflow/files/azure/azure-pipelines.yml__tmpl__ +++ b/packages/workspace/src/generators/ci-workflow/files/azure/azure-pipelines.yml__tmpl__ @@ -55,11 +55,12 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - <% if (connectedToCloud) { %>- script: <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" - <% } else { %># Connect your workspace by running "nx connect" and uncomment this + <% if (connectedToCloud) { %># Uncomment this line to enable task distribution<% } else { %># Connect your workspace by running "nx connect" and uncomment this line to enable task distribution<% } %> # - script: <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" - <% } %> - - script: <%= packageManagerInstall %> + + - script: <%= packageManagerInstall %><% if(hasCypress){ %> + - script: <%= packageManagerPrefix %> cypress install<% } %><% if(hasPlaywright){ %> + - script: <%= packageManagerPrefix %> playwright install<% } %> - script: git branch --track <%= mainBranch %> origin/<%= mainBranch %> condition: eq(variables['Build.Reason'], 'PullRequest') diff --git a/packages/workspace/src/generators/ci-workflow/files/bitbucket-pipelines/bitbucket-pipelines.yml__tmpl__ b/packages/workspace/src/generators/ci-workflow/files/bitbucket-pipelines/bitbucket-pipelines.yml__tmpl__ index 9fc352107e..9a870d26a7 100644 --- a/packages/workspace/src/generators/ci-workflow/files/bitbucket-pipelines/bitbucket-pipelines.yml__tmpl__ +++ b/packages/workspace/src/generators/ci-workflow/files/bitbucket-pipelines/bitbucket-pipelines.yml__tmpl__ @@ -22,11 +22,12 @@ pipelines: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - <% if (connectedToCloud) { %>- <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" - <% } else { %># Connect your workspace by running "nx connect" and uncomment this + <% if (connectedToCloud) { %># Uncomment this line to enable task distribution<% } else { %># Connect your workspace by running "nx connect" and uncomment this line to enable task distribution<% } %> # - <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" - <% } %> - - <%= packageManagerInstall %> + + - <%= packageManagerInstall %><% if(hasCypress){ %> + - <%= packageManagerPrefix %> cypress install<% } %><% if(hasPlaywright){ %> + - <%= packageManagerPrefix %> playwright install<% } %> # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # <%= packageManagerPrefix %> nx-cloud record -- echo Hello World diff --git a/packages/workspace/src/generators/ci-workflow/files/circleci/.circleci/config.yml__tmpl__ b/packages/workspace/src/generators/ci-workflow/files/circleci/.circleci/config.yml__tmpl__ index fd756b1ed1..5ad5cdb14b 100644 --- a/packages/workspace/src/generators/ci-workflow/files/circleci/.circleci/config.yml__tmpl__ +++ b/packages/workspace/src/generators/ci-workflow/files/circleci/.circleci/config.yml__tmpl__ @@ -24,11 +24,12 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - <% if (connectedToCloud) { %>- run: <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" - <% } else { %># Connect your workspace by running "nx connect" and uncomment this + <% if (connectedToCloud) { %># Uncomment this line to enable task distribution<% } else { %># Connect your workspace by running "nx connect" and uncomment this line to enable task distribution<% } %> # - run: <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" - <% } %> - - run: <%= packageManagerInstall %> + + - run: <%= packageManagerInstall %><% if(hasCypress){ %> + - run: <%= packageManagerPrefix %> cypress install<% } %><% if(hasPlaywright){ %> + - run: <%= packageManagerPrefix %> playwright install<% } %> - nx/set-shas: main-branch-name: '<%= mainBranch %>' diff --git a/packages/workspace/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml__tmpl__ b/packages/workspace/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml__tmpl__ index 15856e1733..26f13d5b45 100644 --- a/packages/workspace/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml__tmpl__ +++ b/packages/workspace/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml__tmpl__ @@ -31,10 +31,9 @@ jobs: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - <% if (connectedToCloud) { %>- run: <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" - <% } else { %># Connect your workspace by running "nx connect" and uncomment this + <% if (connectedToCloud) { %># Uncomment this line to enable task distribution<% } else { %># Connect your workspace by running "nx connect" and uncomment this line to enable task distribution<% } %> # - run: <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" - <% } %> + <% if(packageManager != 'bun'){ %> # Cache node_modules - uses: actions/setup-node@v4 @@ -42,7 +41,9 @@ jobs: node-version: 20 cache: '<%= packageManager %>' <% } %> - - run: <%= packageManagerInstall %> + - run: <%= packageManagerInstall %><% if(hasCypress){ %> + - run: <%= packageManagerPrefix %> cypress install<% } %><% if(hasPlaywright){ %> + - run: <%= packageManagerPrefix %> playwright install<% } %> - uses: nrwl/nx-set-shas@v4 # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud diff --git a/packages/workspace/src/generators/ci-workflow/files/gitlab/.gitlab-ci.yml__tmpl__ b/packages/workspace/src/generators/ci-workflow/files/gitlab/.gitlab-ci.yml__tmpl__ index 2bf6d220d4..d5c8dfd298 100644 --- a/packages/workspace/src/generators/ci-workflow/files/gitlab/.gitlab-ci.yml__tmpl__ +++ b/packages/workspace/src/generators/ci-workflow/files/gitlab/.gitlab-ci.yml__tmpl__ @@ -18,11 +18,12 @@ variables: # This enables task distribution via Nx Cloud # Run this command as early as possible, before dependencies are installed # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - <% if (connectedToCloud) { %>- <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" - <% } else { %># Connect your workspace by running "nx connect" and uncomment this + <% if (connectedToCloud) { %># Uncomment this line to enable task distribution<% } else { %># Connect your workspace by running "nx connect" and uncomment this line to enable task distribution<% } %> # - <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" - <% } %> - - <%= packageManagerInstall %> + + - <%= packageManagerInstall %><% if(hasCypress){ %> + - <%= packageManagerPrefix %> cypress install<% } %><% if(hasPlaywright){ %> + - <%= packageManagerPrefix %> playwright install<% } %> - NX_HEAD=$CI_COMMIT_SHA - NX_BASE=${CI_MERGE_REQUEST_DIFF_BASE_SHA:-$CI_COMMIT_BEFORE_SHA}