Skip to content

Commit

Permalink
fix: Improve CI job handling. (#1747)
Browse files Browse the repository at this point in the history
* fix(cli): CI command prints job index for job total line

* fix(cli): CI command unevenly weighs targets for last job index

* chore: bump versions
  • Loading branch information
t3ned authored Dec 7, 2024
1 parent 7a2933c commit 702f7d9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .yarn/versions/15d6e39f.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
releases:
"@moonrepo/cli": patch
"@moonrepo/core-linux-arm64-gnu": patch
"@moonrepo/core-linux-arm64-musl": patch
"@moonrepo/core-linux-x64-gnu": patch
"@moonrepo/core-linux-x64-musl": patch
"@moonrepo/core-macos-arm64": patch
"@moonrepo/core-macos-x64": patch
"@moonrepo/core-windows-x64-msvc": patch
4 changes: 2 additions & 2 deletions crates/app/src/commands/ci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,12 @@ fn distribute_targets_across_jobs(

let job_index = args.job.unwrap_or_default();
let job_total = args.job_total.unwrap_or_default();
let batch_size = targets.len() / job_total;
let batch_size = (targets.len() + job_total - 1) / job_total;
let batched_targets;

console.print_header("Distributing targets across jobs")?;
console.write_line(format!("Job index: {job_index}"))?;
console.write_line(format!("Job total: {job_index}"))?;
console.write_line(format!("Job total: {job_total}"))?;
console.write_line(format!("Batch size: {batch_size}"))?;
console.write_line("Batched targets:")?;

Expand Down

0 comments on commit 702f7d9

Please sign in to comment.