You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/ci/README.md
+28-1Lines changed: 28 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,11 +103,12 @@ Optionally, you can override default options for further customization:
103
103
|`nxProjectsFilter`|`string \| string[]`|`'--with-target={task}'`| Arguments passed to [`nx show projects`](https://nx.dev/nx-api/nx/documents/show#projects), only relevant for Nx in [monorepo mode](#monorepo-mode)[^2]|
104
104
|`directory`|`string`|`process.cwd()`| Directory in which Code PushUp CLI should run |
105
105
|`config`|`string \| null`|`null`[^1]| Path to config file (`--config` option) |
106
-
|`silent`|`boolean`|`false`| Hides logs from CLI commands (erros will be printed)|
106
+
|`silent`|`boolean`|`false`| Hides logs from CLI commands (errors will be printed) |
107
107
|`bin`|`string`|`'npx --no-install code-pushup'`| Command for executing Code PushUp CLI |
108
108
|`detectNewIssues`|`boolean`|`true`| Toggles if new issues should be detected and returned in `newIssues` property |
109
109
|`logger`|`Logger`|`console`| Logger for reporting progress and encountered problems |
110
110
|`skipComment`|`boolean`|`false`| Toggles if comparison comment is posted to PR |
111
+
|`configPatterns`|`ConfigPatterns \| null`|`null`| Additional configuration which enables [faster CI runs](#faster-ci-runs-with-configpatterns)|
111
112
112
113
[^1]: By default, the `code-pushup.config` file is autodetected as described in [`@code-pushup/cli` docs](../cli/README.md#configuration).
113
114
@@ -216,6 +217,32 @@ await runInCI(refs, api, {
216
217
});
217
218
```
218
219
220
+
### Faster CI runs with `configPatterns`
221
+
222
+
By default, the `print-config` command is run sequentially for each project in order to reliably detect how `code-pushup` is configured - specifically, where to read output files from (`persist` config) and whether portal may be used as a cache (`upload` config). This allows for each project to be configured in its own way without breaking anything, but for large monorepos these extra `code-pushup print-config` executions can accumulate and significantly slow down CI pipelines.
223
+
224
+
As a more scalable alternative, `configPatterns` may be provided. A user declares upfront how every project is configured, which allows `print-config` to be skipped. It's the user's responsibility to ensure this configuration holds for every project (it won't be checked). The `configPatterns` support string interpolation, substituting `{projectName}` with each project's name. Other than that, each project's `code-pushup.config` must have exactly the same `persist` and `upload` configurations.
225
+
226
+
```ts
227
+
awaitrunInCI(refs, api, {
228
+
monorepo: true,
229
+
configPatterns: {
230
+
persist: {
231
+
outputDir: '.code-pushup/{projectName}',
232
+
filename: 'report',
233
+
format: ['json', 'md'],
234
+
},
235
+
// optional: will use portal as cache when comparing reports in PRs
0 commit comments