Skip to content

Commit

Permalink
feat(core): add option to disable log grouping on CI (nrwl#21782)
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav authored Feb 12, 2024
1 parent c8866ac commit 4caa6be
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/e2e-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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() }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/e2e-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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() }}
Expand Down
1 change: 1 addition & 0 deletions docs/shared/reference/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
10 changes: 8 additions & 2 deletions packages/nx/src/utils/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
}
Expand All @@ -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);
}
}
Expand Down

0 comments on commit 4caa6be

Please sign in to comment.