docs(core): dte affected commands in parallel (#13115)

This commit is contained in:
Isaac Mann 2022-11-11 10:40:28 -05:00 committed by GitHub
parent 60c220b788
commit ba4e944981
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 9 additions and 28 deletions

View File

@ -15,9 +15,7 @@ The main job execution flow looks like this:
# Coordinate the agents to run the tasks
- npx nx-cloud start-ci-run
# Run any commands you want here
- nx affected --target=lint
- nx affected --target=test
- nx affected --target=build
- nx affected --target=lint & nx affected --target=test & nx affected --target=build
# Stop any run away agents
- npx nx-cloud stop-all-agents
```

View File

@ -41,9 +41,7 @@ The main job execution flow looks like this:
# Coordinate the agents to run the tasks
- npx nx-cloud start-ci-run
# Run any commands you want here
- nx affected --target=lint
- nx affected --target=test
- nx affected --target=build
- nx affected --target=lint & nx affected --target=test & nx affected --target=build
# Stop any run away agents
- npx nx-cloud stop-all-agents
```

View File

@ -86,9 +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
- script: npx nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --target=test --parallel=3 --ci --code-coverage
- script: 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 --ci --code-coverage & 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.

View File

@ -29,9 +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 --ci --code-coverage & npx nx affected --target=build --base=HEAD~1 --parallel --max-parallel=3
```
The `pull-requests` and `main` jobs implement the CI workflow.

View File

@ -75,9 +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
- 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=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 --ci --code-coverage & npx nx affected --base=$NX_BASE --head=$NX_HEAD --target=build --parallel=3
workflows:
build:
jobs:

View File

@ -58,9 +58,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 --ci --code-coverage & npx nx affected --target=build --parallel=3
agents:
name: Nx Cloud - Agents

View File

@ -120,10 +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 --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
# Create as many agents as you want
nx-dte-agent1:

View File

@ -78,9 +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"
sh "npx nx affected --base=HEAD~1 --target=test --parallel=3 --ci --code-coverage"
sh "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 --ci --code-coverage & npx nx affected --base=HEAD~1 --target=build --parallel=3"
}
}
stage('PR') {
@ -93,9 +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"
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=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 --ci --code-coverage & npx nx affected --base origin/${env.CHANGE_TARGET} --target=build --parallel=3"
}
}