feat(core): add option to disable log grouping on CI (#21782)

This commit is contained in:
Miroslav Jonaš 2024-02-12 19:07:03 +01:00 committed by GitHub
parent c8866acb4a
commit 4caa6be71a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 11 additions and 2 deletions

View File

@ -399,6 +399,7 @@ jobs:
NX_E2E_VERBOSE_LOGGING: 'true'
NX_PERF_LOGGING: 'false'
NX_DAEMON: 'true'
NX_SKIP_LOG_GROUPING: 'true'
- name: Save matrix config in file
if: ${{ always() }}

View File

@ -297,6 +297,7 @@ jobs:
NX_E2E_VERBOSE_LOGGING: 'true'
NX_PERF_LOGGING: 'false'
NX_DAEMON: 'true'
NX_SKIP_LOG_GROUPING: 'true'
- name: Save matrix config in file
if: ${{ always() }}

View File

@ -27,6 +27,7 @@ The following environment variables are ones that you can set to change the beha
| NX_PREFER_TS_NODE | boolean | If set to `true`, Nx will use ts-node for local execution of plugins even if `@swc-node/register` is installed. |
| NX_IGNORE_CYCLES | boolean | If set to `true`, Nx will ignore errors created by a task graph circular dependency. Can be overriden on the command line with `--nxIgnoreCycles` |
| NX_BATCH_MODE | boolean | If set to `true`, Nx will run task(s) in batches for executors which support batches. |
| NX_SKIP_LOG_GROUPING | boolean | If set to `true`, Nx will not group command's logs on CI. |
Nx will set the following environment variables so they can be accessible within the process even outside of executors and generators.

View File

@ -241,7 +241,10 @@ class CLIOutput {
message,
taskStatus
);
if (process.env.GITHUB_ACTIONS) {
if (
process.env.NX_SKIP_LOG_GROUPING !== 'true' &&
process.env.GITHUB_ACTIONS
) {
const icon = this.getStatusIcon(taskStatus);
commandOutputWithStatus = `${GH_GROUP_PREFIX}${icon} ${commandOutputWithStatus}`;
}
@ -252,7 +255,10 @@ class CLIOutput {
this.addNewline();
this.writeToStdOut(output);
if (process.env.GITHUB_ACTIONS) {
if (
process.env.NX_SKIP_LOG_GROUPING !== 'true' &&
process.env.GITHUB_ACTIONS
) {
this.writeToStdOut(GH_GROUP_SUFFIX);
}
}