docs(core): dte affected commands in parallel (#13115)
This commit is contained in:
parent
60c220b788
commit
ba4e944981
@ -15,9 +15,7 @@ The main job execution flow looks like this:
|
|||||||
# Coordinate the agents to run the tasks
|
# Coordinate the agents to run the tasks
|
||||||
- npx nx-cloud start-ci-run
|
- npx nx-cloud start-ci-run
|
||||||
# Run any commands you want here
|
# Run any commands you want here
|
||||||
- nx affected --target=lint
|
- nx affected --target=lint & nx affected --target=test & nx affected --target=build
|
||||||
- nx affected --target=test
|
|
||||||
- nx affected --target=build
|
|
||||||
# Stop any run away agents
|
# Stop any run away agents
|
||||||
- npx nx-cloud stop-all-agents
|
- npx nx-cloud stop-all-agents
|
||||||
```
|
```
|
||||||
|
|||||||
@ -41,9 +41,7 @@ The main job execution flow looks like this:
|
|||||||
# Coordinate the agents to run the tasks
|
# Coordinate the agents to run the tasks
|
||||||
- npx nx-cloud start-ci-run
|
- npx nx-cloud start-ci-run
|
||||||
# Run any commands you want here
|
# Run any commands you want here
|
||||||
- nx affected --target=lint
|
- nx affected --target=lint & nx affected --target=test & nx affected --target=build
|
||||||
- nx affected --target=test
|
|
||||||
- nx affected --target=build
|
|
||||||
# Stop any run away agents
|
# Stop any run away agents
|
||||||
- npx nx-cloud stop-all-agents
|
- npx nx-cloud stop-all-agents
|
||||||
```
|
```
|
||||||
|
|||||||
@ -86,9 +86,7 @@ jobs:
|
|||||||
|
|
||||||
- script: npx nx-cloud record -- npx nx workspace-lint
|
- 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-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=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=test --parallel=3 --ci --code-coverage
|
|
||||||
- script: 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.
|
You can also use our [ci-workflow generator](/packages/workspace/generators/ci-workflow) to generate the pipeline file.
|
||||||
|
|||||||
@ -29,9 +29,7 @@ pipelines:
|
|||||||
- npm ci
|
- npm ci
|
||||||
- npx nx workspace-lint
|
- npx nx workspace-lint
|
||||||
- npx nx format:check
|
- npx nx format:check
|
||||||
- npx nx affected --target=lint --base=origin/master --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
|
||||||
- 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.
|
The `pull-requests` and `main` jobs implement the CI workflow.
|
||||||
|
|||||||
@ -75,9 +75,7 @@ jobs:
|
|||||||
|
|
||||||
- run: npx nx-cloud record -- npx nx workspace-lint
|
- run: npx nx-cloud record -- npx nx workspace-lint
|
||||||
- run: npx nx-cloud record -- npx nx format:check
|
- 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=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=test --parallel=3 --ci --code-coverage
|
|
||||||
- run: npx nx affected --base=$NX_BASE --head=$NX_HEAD --target=build --parallel=3
|
|
||||||
workflows:
|
workflows:
|
||||||
build:
|
build:
|
||||||
jobs:
|
jobs:
|
||||||
|
|||||||
@ -58,9 +58,7 @@ jobs:
|
|||||||
npx nx-cloud record -- npx nx workspace-lint
|
npx nx-cloud record -- npx nx workspace-lint
|
||||||
npx nx-cloud record -- npx nx format:check
|
npx nx-cloud record -- npx nx format:check
|
||||||
parallel-commands-on-agents: |
|
parallel-commands-on-agents: |
|
||||||
npx nx affected --target=lint --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
|
||||||
npx nx affected --target=test --parallel=3 --ci --code-coverage
|
|
||||||
npx nx affected --target=build --parallel=3
|
|
||||||
|
|
||||||
agents:
|
agents:
|
||||||
name: Nx Cloud - Agents
|
name: Nx Cloud - Agents
|
||||||
|
|||||||
@ -120,10 +120,7 @@ nx-dte:
|
|||||||
- yarn nx-cloud start-ci-run --stop-agents-after="build"
|
- 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 workspace-lint --base=$NX_BASE --head=$NX_HEAD
|
||||||
- yarn nx-cloud record -- yarn nx format:check --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=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=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
|
# Create as many agents as you want
|
||||||
nx-dte-agent1:
|
nx-dte-agent1:
|
||||||
|
|||||||
@ -78,9 +78,7 @@ pipeline {
|
|||||||
sh "npx nx-cloud start-ci-run --stop-agents-after='build'"
|
sh "npx nx-cloud start-ci-run --stop-agents-after='build'"
|
||||||
sh "npx nx workspace-lint"
|
sh "npx nx workspace-lint"
|
||||||
sh "npx nx format:check"
|
sh "npx nx format:check"
|
||||||
sh "npx nx affected --base=HEAD~1 --target=lint --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"
|
||||||
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"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('PR') {
|
stage('PR') {
|
||||||
@ -93,9 +91,7 @@ pipeline {
|
|||||||
sh "npx nx-cloud start-ci-run --stop-agents-after='build'"
|
sh "npx nx-cloud start-ci-run --stop-agents-after='build'"
|
||||||
sh "npx nx workspace-lint"
|
sh "npx nx workspace-lint"
|
||||||
sh "npx nx format:check"
|
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=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=test --parallel=3 --ci --code-coverage"
|
|
||||||
sh "npx nx affected --base origin/${env.CHANGE_TARGET} --target=build --parallel=3"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user