juanri0s/Optimal CI Matrix
Generate optimal CI matrix for parallel job execution. Calculates batch counts per project based on file counts.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stale
- License
- None
Inputs
| name | description | required | default |
|---|---|---|---|
| projects | JSON array of project names or paths to include in the matrix (e.g., ["project1", "project2"] or ["."] for single project) | yes | — |
| base-path | Base path for project directories. Use "." for current directory or specify a relative path to your projects. | no | . |
| files-per-job | Target number of files per job. Used to calculate optimal batch count. Adjust based on your project size and desired parallelism. | no | 50 |
| min-jobs | Minimum number of parallel jobs per project. Ensures minimum parallelism even for small projects. | no | 1 |
| max-jobs | Maximum number of parallel jobs per project. Prevents excessive job creation for very large projects. | no | 10 |
| file-patterns | Comma-separated glob patterns to match files for counting. Use patterns that match your test files or files you want to parallelize. | no | **/* |
Outputs
| name | description |
|---|---|
| matrix | JSON array of matrix entries. Each entry contains project name, batch number (1-indexed), and total_batches. Use total_batches to determine how many batches each project should be split into. Example: [{"project":"p1","batch":1,"total_batches":3},{"project":"p1","batch":2,"total_batches":3},{"project":"p1","batch":3,"total_batches":3}] |