diff --git a/docs/nx-cloud/tutorial/circle.md b/docs/nx-cloud/tutorial/circle.md index f1402be6f3..6e9fb11b3f 100644 --- a/docs/nx-cloud/tutorial/circle.md +++ b/docs/nx-cloud/tutorial/circle.md @@ -230,9 +230,9 @@ The Nx Agents feature - collects the results and logs of all the tasks and presents them in a single view - automatically shuts down agents when they are no longer needed -To enable Nx Agents, make sure the following line is uncommented in the `.circleci/config.yml` file. +To enable Nx Agents, make sure the `nx-cloud start-ci-run` line is uncommented in the `.circleci/config.yml` file and the `nx affected` line runs the `e2e-ci` task instead of `e2e`. -```yml {% fileName=".circleci/config.yml" highlightLines=["21"] %} +```yml {% fileName=".circleci/config.yml" highlightLines=["21","29"] %} version: 2.1 orbs: diff --git a/docs/nx-cloud/tutorial/github-actions.md b/docs/nx-cloud/tutorial/github-actions.md index dd3a0d3bfb..d35e4d76e8 100644 --- a/docs/nx-cloud/tutorial/github-actions.md +++ b/docs/nx-cloud/tutorial/github-actions.md @@ -195,7 +195,7 @@ The Nx Agents feature - collects the results and logs of all the tasks and presents them in a single view - automatically shuts down agents when they are no longer needed -To enable Nx Agents, make sure the following line is uncommented in the `.github/workflows/ci.yml` file. +To enable Nx Agents, make sure the `nx-cloud start-ci-run` line is uncommented in the `.github/workflows/ci.yml` file and the `nx affected` line runs the `e2e-ci` task instead of `e2e`. ```yml {% fileName=".github/workflows/ci.yml" highlightLines=[19] %} name: CI diff --git a/docs/shared/tutorials/angular-monorepo.md b/docs/shared/tutorials/angular-monorepo.md index 8ce44f6fb8..1122dcc1b5 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. 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. +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 and have the `nx affected` line run the `e2e-ci` task instead of `e2e`. If you need to generate a new workflow file for GitHub Actions or other providers, you can do so with this command: @@ -1285,7 +1285,7 @@ npx nx generate ci-workflow The key lines in the CI pipeline are: -```yml {% fileName=".github/workflows/ci.yml" highlightLines=["10-14", "21-22"] %} +```yml {% fileName=".github/workflows/ci.yml" highlightLines=["10-14", "21-23"] %} name: CI # ... jobs: @@ -1299,7 +1299,7 @@ jobs: # 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 # 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: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" - uses: actions/setup-node@v3 with: node-version: 20 @@ -1307,7 +1307,8 @@ jobs: - run: npm ci --legacy-peer-deps - uses: nrwl/nx-set-shas@v4 # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - run: npx nx affected -t lint test build + # When you enable task distribution, run the e2e-ci task instead of e2e + - run: npx nx affected -t lint test build e2e ``` ### Open a Pull Request {% highlightColor="green" %} diff --git a/docs/shared/tutorials/angular-standalone.md b/docs/shared/tutorials/angular-standalone.md index 5b930e94c9..8e344b8821 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. 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. +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 and have the `nx affected` line run the `e2e-ci` task instead of `e2e`. If you need to generate a new workflow file for GitHub Actions or other providers, you can do so with this command: @@ -1085,7 +1085,7 @@ npx nx generate ci-workflow The key lines in the CI pipeline are: -```yml {% fileName=".github/workflows/ci.yml" highlightLines=["10-14", "21-22"] %} +```yml {% fileName=".github/workflows/ci.yml" highlightLines=["10-14", "21-23"] %} name: CI # ... jobs: @@ -1099,7 +1099,7 @@ jobs: # 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 # 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: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" - uses: actions/setup-node@v3 with: node-version: 20 @@ -1107,7 +1107,8 @@ jobs: - run: npm ci --legacy-peer-deps - uses: nrwl/nx-set-shas@v4 # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - run: npx nx affected -t lint test build + # When you enable task distribution, run the e2e-ci task instead of e2e + - run: npx nx affected -t lint test build e2e ``` ### Open a Pull Request {% highlightColor="green" %} diff --git a/docs/shared/tutorials/npm-workspaces.md b/docs/shared/tutorials/npm-workspaces.md index b2c88e2d71..081547b422 100644 --- a/docs/shared/tutorials/npm-workspaces.md +++ b/docs/shared/tutorials/npm-workspaces.md @@ -440,11 +440,11 @@ 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. 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. +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 and have the `nx affected` line run the `e2e-ci` task instead of `e2e`. The key lines in the CI pipeline are: -```yml {% fileName=".github/workflows/ci.yml" highlightLines=["10-14", "21-22"] %} +```yml {% fileName=".github/workflows/ci.yml" highlightLines=["10-14", "21-23"] %} name: CI # ... jobs: @@ -458,7 +458,7 @@ jobs: # 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 # 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: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" - uses: actions/setup-node@v3 with: node-version: 20 @@ -466,7 +466,8 @@ jobs: - run: npm ci --legacy-peer-deps - uses: nrwl/nx-set-shas@v4 # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - run: npx nx affected -t lint test build + # When you enable task distribution, run the e2e-ci task instead of e2e + - run: npx nx affected -t lint test build e2e ``` ### Open a Pull Request {% highlightColor="green" %} diff --git a/docs/shared/tutorials/react-monorepo.md b/docs/shared/tutorials/react-monorepo.md index 87c59f1d75..2e00fa7aa5 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. 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. +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 and have the `nx affected` line run the `e2e-ci` task instead of `e2e`. If you need to generate a new workflow file for GitHub Actions or other providers, you can do so with this command: @@ -1088,7 +1088,7 @@ npx nx generate ci-workflow The key lines in the CI pipeline are: -```yml {% fileName=".github/workflows/ci.yml" highlightLines=["10-14", "21-22"] %} +```yml {% fileName=".github/workflows/ci.yml" highlightLines=["10-14", "21-23"] %} name: CI # ... jobs: @@ -1102,7 +1102,7 @@ jobs: # 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 # 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: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" - uses: actions/setup-node@v3 with: node-version: 20 @@ -1110,7 +1110,8 @@ jobs: - run: npm ci --legacy-peer-deps - uses: nrwl/nx-set-shas@v4 # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - run: npx nx affected -t lint test build + # When you enable task distribution, run the e2e-ci task instead of e2e + - run: npx nx affected -t lint test build e2e ``` ### Open a Pull Request {% highlightColor="green" %} diff --git a/docs/shared/tutorials/react-standalone.md b/docs/shared/tutorials/react-standalone.md index a429c73e80..92bcbfc13e 100644 --- a/docs/shared/tutorials/react-standalone.md +++ b/docs/shared/tutorials/react-standalone.md @@ -1033,11 +1033,11 @@ 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. 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. +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 and have the `nx affected` line run the `e2e-ci` task instead of `e2e`. The key lines in the CI pipeline are: -```yml {% fileName=".github/workflows/ci.yml" highlightLines=["10-14", "21-22"] %} +```yml {% fileName=".github/workflows/ci.yml" highlightLines=["10-14", "21-23"] %} name: CI # ... jobs: @@ -1050,8 +1050,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="e2e-ci" - uses: actions/setup-node@v3 with: node-version: 20 @@ -1059,7 +1059,8 @@ jobs: - run: npm ci --legacy-peer-deps - uses: nrwl/nx-set-shas@v4 # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - run: npx nx affected -t lint test build + # When you enable task distribution, run the e2e-ci task instead of e2e + - run: npx nx affected -t lint test build e2e ``` ### Open a Pull Request {% highlightColor="green" %} diff --git a/docs/shared/tutorials/vue-standalone.md b/docs/shared/tutorials/vue-standalone.md index 46ad2b274d..9cd267562f 100644 --- a/docs/shared/tutorials/vue-standalone.md +++ b/docs/shared/tutorials/vue-standalone.md @@ -1081,11 +1081,11 @@ 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. 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. +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 and have the `nx affected` line run the `e2e-ci` task instead of `e2e`. The key lines in the CI pipeline are: -```yml {% fileName=".github/workflows/ci.yml" highlightLines=["10-14", "21-22"] %} +```yml {% fileName=".github/workflows/ci.yml" highlightLines=["10-14", "21-23"] %} name: CI # ... jobs: @@ -1099,7 +1099,7 @@ jobs: # 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 # 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: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" - uses: actions/setup-node@v3 with: node-version: 20 @@ -1107,7 +1107,8 @@ jobs: - run: npm ci --legacy-peer-deps - uses: nrwl/nx-set-shas@v4 # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - run: npx nx affected -t lint test build + # When you enable task distribution, run the e2e-ci task instead of e2e + - run: npx nx affected -t lint test build e2e ``` ### Open a Pull Request {% highlightColor="green" %} 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 0a19a034e9..595ddaf931 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 @@ -58,7 +58,8 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - script: npx nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - script: npx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) lint test build e2e-ci + # When you enable task distribution, run the e2e-ci task instead of e2e + - script: npx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) lint test build e2e " `; @@ -88,8 +89,8 @@ pipelines: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # npx nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - npx nx affected --base=origin/main -t lint test build - - npx nx affected --base=origin/main --parallel 1 -t e2e-ci + # When you enable task distribution, run the e2e-ci task instead of e2e + - npx nx affected --base=origin/main -t lint test build e2e branches: main: @@ -138,7 +139,8 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - run: npx nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - run: npx nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build e2e-ci + # When you enable task distribution, run the e2e-ci task instead of e2e + - run: npx nx affected -t lint test build e2e workflows: version: 2 @@ -189,7 +191,8 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - run: npx nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - run: npx nx affected -t lint test build e2e-ci + # When you enable task distribution, run the e2e-ci task instead of e2e + - run: npx nx affected -t lint test build e2e " `; @@ -233,7 +236,8 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - run: npx nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - run: npx nx affected -t lint test build e2e-ci + # When you enable task distribution, run the e2e-ci task instead of e2e + - run: npx nx affected -t lint test build e2e " `; @@ -382,7 +386,7 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - run: bun nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - run: bun nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build + - run: bun nx affected -t lint test build workflows: version: 2 @@ -502,7 +506,7 @@ CI: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - bun nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - bun nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build + - bun nx affected -t lint test build " `; @@ -640,7 +644,7 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - run: npx nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - run: npx nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build + - run: npx nx affected -t lint test build workflows: version: 2 @@ -762,7 +766,7 @@ CI: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - npx nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - npx nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build + - npx nx affected -t lint test build " `; @@ -911,7 +915,7 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - run: pnpm exec nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - run: pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build + - run: pnpm exec nx affected -t lint test build workflows: version: 2 @@ -1043,7 +1047,7 @@ CI: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - pnpm exec nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build + - pnpm exec nx affected -t lint test build " `; @@ -1181,7 +1185,7 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - run: yarn nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - run: yarn nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build + - run: yarn nx affected -t lint test build workflows: version: 2 @@ -1303,7 +1307,7 @@ CI: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - yarn nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - yarn nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build + - yarn nx affected -t lint test build " `; @@ -1365,7 +1369,8 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - script: npx nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - script: npx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) lint test build e2e-ci + # When you enable task distribution, run the e2e-ci task instead of e2e + - script: npx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) lint test build e2e " `; @@ -1395,8 +1400,8 @@ pipelines: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # npx nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - npx nx affected --base=origin/main -t lint test build - - npx nx affected --base=origin/main --parallel 1 -t e2e-ci + # When you enable task distribution, run the e2e-ci task instead of e2e + - npx nx affected --base=origin/main -t lint test build e2e branches: main: @@ -1446,7 +1451,8 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - run: npx nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - run: npx nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build e2e-ci + # When you enable task distribution, run the e2e-ci task instead of e2e + - run: npx nx affected -t lint test build e2e workflows: version: 2 @@ -1497,7 +1503,8 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - run: npx nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - run: npx nx affected -t lint test build e2e-ci + # When you enable task distribution, run the e2e-ci task instead of e2e + - run: npx nx affected -t lint test build e2e " `; @@ -1541,7 +1548,8 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - run: npx nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - run: npx nx affected -t lint test build e2e-ci + # When you enable task distribution, run the e2e-ci task instead of e2e + - run: npx nx affected -t lint test build e2e " `; @@ -1691,7 +1699,7 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - run: bun nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - run: bun nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build + - run: bun nx affected -t lint test build workflows: version: 2 @@ -1811,7 +1819,7 @@ CI: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - bun nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - bun nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build + - bun nx affected -t lint test build " `; @@ -1950,7 +1958,7 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - run: npx nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - run: npx nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build + - run: npx nx affected -t lint test build workflows: version: 2 @@ -2072,7 +2080,7 @@ CI: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - npx nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - npx nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build + - npx nx affected -t lint test build " `; @@ -2222,7 +2230,7 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - run: pnpm exec nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - run: pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build + - run: pnpm exec nx affected -t lint test build workflows: version: 2 @@ -2354,7 +2362,7 @@ CI: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - pnpm exec nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - pnpm exec nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build + - pnpm exec nx affected -t lint test build " `; @@ -2493,7 +2501,7 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - run: yarn nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - run: yarn nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build + - run: yarn nx affected -t lint test build workflows: version: 2 @@ -2615,6 +2623,6 @@ CI: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - yarn nx-cloud record -- echo Hello World # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - yarn nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build + - yarn nx affected -t lint test build " `; 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 119c396048..b851a42475 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__ @@ -66,5 +66,6 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - script: <%= packageManagerPrefix %> nx-cloud record -- echo Hello World - # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - script: <%= packageManagerPrefix %> nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) lint test build<% if(hasE2E){ %> e2e-ci<% } %> + # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected<% if(hasE2E){ %> + # When you enable task distribution, run the e2e-ci task instead of e2e<% } %> + - script: <%= packageManagerPrefix %> nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) lint test build<% if(hasE2E){ %> e2e<% } %> 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 9a870d26a7..127c7044be 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__ @@ -31,9 +31,9 @@ pipelines: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # <%= packageManagerPrefix %> nx-cloud record -- echo Hello World - # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - <%= packageManagerPrefix %> nx affected --base=origin/<%= mainBranch %> -t lint test build<% if(hasE2E){ %> - - <%= packageManagerPrefix %> nx affected --base=origin/<%= mainBranch %> --parallel 1 -t e2e-ci<% } %> + # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected<% if(hasE2E){ %> + # When you enable task distribution, run the e2e-ci task instead of e2e<% } %> + - <%= packageManagerPrefix %> nx affected --base=origin/<%= mainBranch %> -t lint test build<% if(hasE2E){ %> e2e<% } %> branches: main: 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 5ad5cdb14b..b6c7c66cbf 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__ @@ -35,8 +35,9 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - run: <%= packageManagerPrefix %> nx-cloud record -- echo Hello World - # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - run: <%= packageManagerPrefix %> nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build<% if(hasE2E){ %> e2e-ci<% } %> + # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected<% if(hasE2E){ %> + # When you enable task distribution, run the e2e-ci task instead of e2e<% } %> + - run: <%= packageManagerPrefix %> nx affected -t lint test build<% if(hasE2E){ %> e2e<% } %> workflows: version: 2 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 26f13d5b45..0d65703608 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__ @@ -48,5 +48,6 @@ jobs: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - run: <%= packageManagerPrefix %> nx-cloud record -- echo Hello World - # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - run: <%= packageManagerPrefix %> nx affected -t lint test build<% if(hasE2E){ %> e2e-ci<% } %> + # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected<% if(hasE2E){ %> + # When you enable task distribution, run the e2e-ci task instead of e2e<% } %> + - run: <%= packageManagerPrefix %> nx affected -t lint test build<% if(hasE2E){ %> e2e<% } %> 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 d5c8dfd298..3e5cd5f439 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__ @@ -29,5 +29,6 @@ variables: # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud # - <%= packageManagerPrefix %> nx-cloud record -- echo Hello World - # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected - - <%= packageManagerPrefix %> nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build<% if(hasE2E){ %> e2e-ci<% } %> + # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected<% if(hasE2E){ %> + # When you enable task distribution, run the e2e-ci task instead of e2e<% } %> + - <%= packageManagerPrefix %> nx affected -t lint test build<% if(hasE2E){ %> e2e<% } %>