diff --git a/docs/shared/monorepo-ci-azure.md b/docs/shared/monorepo-ci-azure.md index 8bd48aeca27afb..6823e3574efd47 100644 --- a/docs/shared/monorepo-ci-azure.md +++ b/docs/shared/monorepo-ci-azure.md @@ -34,7 +34,7 @@ jobs: - script: npx nx format:check - script: npx nx affected --base=$(BASE_SHA) --target=lint --parallel=3 - - script: npx nx affected --base=$(BASE_SHA) --target=test --parallel=3 --ci --code-coverage + - script: npx nx affected --base=$(BASE_SHA) --target=test --parallel=3 --configuration=ci - script: npx nx affected --base=$(BASE_SHA) --target=build --parallel=3 ``` @@ -86,7 +86,7 @@ jobs: - script: npx nx-cloud record -- npx nx workspace-lint - script: npx nx-cloud record -- npx nx format:check --base=$(BASE_SHA) --head=$(HEAD_SHA) - - script: npx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --target=lint --parallel=3 & npx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --target=test --parallel=3 --ci --code-coverage & npx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --target=build --parallel=3 + - script: npx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --target=lint --parallel=3 & npx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --target=test --parallel=3 --configuration=ci & npx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --target=build --parallel=3 ``` You can also use our [ci-workflow generator](/packages/workspace/generators/ci-workflow) to generate the pipeline file. diff --git a/docs/shared/monorepo-ci-bitbucket-pipelines.md b/docs/shared/monorepo-ci-bitbucket-pipelines.md index 0da68539c875ec..eb61b4b7255517 100644 --- a/docs/shared/monorepo-ci-bitbucket-pipelines.md +++ b/docs/shared/monorepo-ci-bitbucket-pipelines.md @@ -16,7 +16,7 @@ pipelines: - npx nx workspace-lint - npx nx format:check - npx nx affected --target=lint --base=origin/master --parallel --max-parallel=3 - - npx nx affected --target=test --base=origin/master --parallel --max-parallel=3 --ci --code-coverage + - npx nx affected --target=test --base=origin/master --parallel --max-parallel=3 --configuration=ci - npx nx affected --target=build --base=origin/master --head=HEAD --parallel --max-parallel=3 branches: @@ -29,7 +29,7 @@ pipelines: - npm ci - npx nx workspace-lint - npx nx format:check - - npx nx affected --target=lint --base=origin/master --parallel --max-parallel=3 & npx nx affected --target=test --base=HEAD~1 --parallel --max-parallel=3 --ci --code-coverage & npx nx affected --target=build --base=HEAD~1 --parallel --max-parallel=3 + - npx nx affected --target=lint --base=origin/master --parallel --max-parallel=3 & npx nx affected --target=test --base=HEAD~1 --parallel --max-parallel=3 --configuration=ci & npx nx affected --target=build --base=HEAD~1 --parallel --max-parallel=3 ``` The `pull-requests` and `main` jobs implement the CI workflow. diff --git a/docs/shared/monorepo-ci-circle-ci.md b/docs/shared/monorepo-ci-circle-ci.md index a2346ed4704a93..ee7242c9679d64 100644 --- a/docs/shared/monorepo-ci-circle-ci.md +++ b/docs/shared/monorepo-ci-circle-ci.md @@ -21,7 +21,7 @@ jobs: - run: npx nx workspace-lint - run: npx nx format:check - run: npx nx affected --base=$NX_BASE --head=$NX_HEAD --target=lint --parallel=3 - - run: npx nx affected --base=$NX_BASE --head=$NX_HEAD --target=test --parallel=3 --ci --code-coverage + - run: npx nx affected --base=$NX_BASE --head=$NX_HEAD --target=test --parallel=3 --configuration=ci - run: npx nx affected --base=$NX_BASE --head=$NX_HEAD --target=build --parallel=3 workflows: build: @@ -75,7 +75,7 @@ jobs: - run: npx nx-cloud record -- npx nx workspace-lint - run: npx nx-cloud record -- npx nx format:check - - run: npx nx affected --base=$NX_BASE --head=$NX_HEAD --target=lint --parallel=3 & npx nx affected --base=$NX_BASE --head=$NX_HEAD --target=test --parallel=3 --ci --code-coverage & npx nx affected --base=$NX_BASE --head=$NX_HEAD --target=build --parallel=3 + - run: npx nx affected --base=$NX_BASE --head=$NX_HEAD --target=lint --parallel=3 & npx nx affected --base=$NX_BASE --head=$NX_HEAD --target=test --parallel=3 --configuration=ci & npx nx affected --base=$NX_BASE --head=$NX_HEAD --target=build --parallel=3 workflows: build: jobs: diff --git a/docs/shared/monorepo-ci-github-actions.md b/docs/shared/monorepo-ci-github-actions.md index d4b0cf0632a913..53e140364b5c33 100644 --- a/docs/shared/monorepo-ci-github-actions.md +++ b/docs/shared/monorepo-ci-github-actions.md @@ -26,7 +26,7 @@ jobs: - run: npx nx workspace-lint - run: npx nx format:check - run: npx nx affected --target=lint --parallel=3 - - run: npx nx affected --target=test --parallel=3 --ci --code-coverage + - run: npx nx affected --target=test --parallel=3 --configuration=ci - run: npx nx affected --target=build --parallel=3 ``` @@ -64,7 +64,7 @@ jobs: npx nx-cloud record -- npx nx workspace-lint npx nx-cloud record -- npx nx format:check parallel-commands-on-agents: | - npx nx affected --target=lint --parallel=3 & npx nx affected --target=test --parallel=3 --ci --code-coverage & npx nx affected --target=build --parallel=3 + npx nx affected --target=lint --parallel=3 & npx nx affected --target=test --parallel=3 --configuration=ci & npx nx affected --target=build --parallel=3 agents: name: Nx Cloud - Agents diff --git a/docs/shared/monorepo-ci-gitlab.md b/docs/shared/monorepo-ci-gitlab.md index 93c5f8fc397c58..7284a6f1dbed02 100644 --- a/docs/shared/monorepo-ci-gitlab.md +++ b/docs/shared/monorepo-ci-gitlab.md @@ -50,7 +50,7 @@ test: stage: test extends: .distributed script: - - npx nx affected --base=$NX_BASE --head=$NX_HEAD --target=test --parallel=3 --ci --code-coverage + - npx nx affected --base=$NX_BASE --head=$NX_HEAD --target=test --parallel=3 --configuration=ci build: stage: build @@ -120,7 +120,7 @@ nx-dte: - yarn nx-cloud start-ci-run --stop-agents-after="build" - yarn nx-cloud record -- yarn nx workspace-lint --base=$NX_BASE --head=$NX_HEAD - yarn nx-cloud record -- yarn nx format:check --base=$NX_BASE --head=$NX_HEAD - - yarn nx affected --base=$NX_BASE --head=$NX_HEAD --target=lint --parallel=3 & yarn nx affected --base=$NX_BASE --head=$NX_HEAD --target=test --parallel=3 --ci --code-coverage & yarn nx affected --base=$NX_BASE --head=$NX_HEAD --target=e2e --parallel=3 --ci --code-coverage & yarn nx affected --base=$NX_BASE --head=$NX_HEAD --target=build --parallel=3 + - yarn nx affected --base=$NX_BASE --head=$NX_HEAD --target=lint --parallel=3 & yarn nx affected --base=$NX_BASE --head=$NX_HEAD --target=test --parallel=3 --configuration=ci & yarn nx affected --base=$NX_BASE --head=$NX_HEAD --target=e2e --parallel=3 & yarn nx affected --base=$NX_BASE --head=$NX_HEAD --target=build --parallel=3 # Create as many agents as you want nx-dte-agent1: diff --git a/docs/shared/monorepo-ci-jenkins.md b/docs/shared/monorepo-ci-jenkins.md index b0f9cb2d8aa8bd..d0e418c5bd0890 100644 --- a/docs/shared/monorepo-ci-jenkins.md +++ b/docs/shared/monorepo-ci-jenkins.md @@ -39,7 +39,7 @@ pipeline { sh "npx nx workspace-lint" sh "npx nx format:check" sh "npx nx affected --base origin/${env.CHANGE_TARGET} --target=lint --parallel=3" - sh "npx nx affected --base origin/${env.CHANGE_TARGET} --target=test --parallel=3 --ci --code-coverage" + sh "npx nx affected --base origin/${env.CHANGE_TARGET} --target=test --parallel=3 --configuration=ci" sh "npx nx affected --base origin/${env.CHANGE_TARGET} --target=build --parallel=3" } } @@ -78,7 +78,7 @@ pipeline { sh "npx nx-cloud start-ci-run --stop-agents-after='build'" sh "npx nx workspace-lint" sh "npx nx format:check" - sh "npx nx affected --base=HEAD~1 --target=lint --parallel=3 & npx nx affected --base=HEAD~1 --target=test --parallel=3 --ci --code-coverage & npx nx affected --base=HEAD~1 --target=build --parallel=3" + sh "npx nx affected --base=HEAD~1 --target=lint --parallel=3 & npx nx affected --base=HEAD~1 --target=test --parallel=3 --configuration=ci & npx nx affected --base=HEAD~1 --target=build --parallel=3" } } stage('PR') { @@ -91,7 +91,7 @@ pipeline { sh "npx nx-cloud start-ci-run --stop-agents-after='build'" sh "npx nx workspace-lint" sh "npx nx format:check" - sh "npx nx affected --base origin/${env.CHANGE_TARGET} --target=lint --parallel=3 & npx nx affected --base origin/${env.CHANGE_TARGET} --target=test --parallel=3 --ci --code-coverage & npx nx affected --base origin/${env.CHANGE_TARGET} --target=build --parallel=3" + sh "npx nx affected --base origin/${env.CHANGE_TARGET} --target=lint --parallel=3 & npx nx affected --base origin/${env.CHANGE_TARGET} --target=test --parallel=3 --configuration=ci & npx nx affected --base origin/${env.CHANGE_TARGET} --target=build --parallel=3" } } diff --git a/packages/jest/src/generators/jest-project/jest-project.spec.ts b/packages/jest/src/generators/jest-project/jest-project.spec.ts index 1a4a8ba243db1b..57e2d817a793c5 100644 --- a/packages/jest/src/generators/jest-project/jest-project.spec.ts +++ b/packages/jest/src/generators/jest-project/jest-project.spec.ts @@ -79,6 +79,12 @@ describe('jestProject', () => { jestConfig: 'libs/lib1/jest.config.ts', passWithNoTests: true, }, + configurations: { + ci: { + ci: true, + codeCoverage: true, + }, + }, }); expect(lib1.targets.lint.options.tsConfig).toContain( 'libs/lib1/tsconfig.spec.json' diff --git a/packages/jest/src/generators/jest-project/lib/update-workspace.ts b/packages/jest/src/generators/jest-project/lib/update-workspace.ts index 52dcdf902345a4..c9807756422ddb 100644 --- a/packages/jest/src/generators/jest-project/lib/update-workspace.ts +++ b/packages/jest/src/generators/jest-project/lib/update-workspace.ts @@ -23,6 +23,12 @@ export function updateWorkspace(tree: Tree, options: JestProjectSchema) { ), passWithNoTests: true, }, + configurations: { + ci: { + ci: true, + codeCoverage: true, + }, + }, }; const isUsingTSLint =