cmd/lib/ci_matrix: only use macos-10.15 when needed; prefer macos-11 (#124506)

This commit is contained in:
Bo Anderson 2022-05-30 01:50:31 +01:00 committed by GitHub
parent 4a9bcc5408
commit 26ed6e788f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -8,9 +8,9 @@ module CiMatrix
MAX_JOBS = 256
RUNNERS = {
{ symbol: :catalina, name: "macos-10.15" } => 0.9,
{ symbol: :big_sur, name: "macos-11" } => 0.1,
{ symbol: :monterey, name: "macos-12" } => 0.1,
{ symbol: :catalina, name: "macos-10.15" } => 0,
{ symbol: :big_sur, name: "macos-11" } => 0.9,
{ symbol: :monterey, name: "macos-12" } => 0.1,
}.freeze
# This string uses regex syntax and is intended to be interpolated into
@ -57,7 +57,9 @@ module CiMatrix
end
def self.random_runner(avalible_runners = RUNNERS)
avalible_runners.max_by { |(_, weight)| rand ** (1.0 / weight) }.first
avalible_runners.reject { |_, weight| weight.zero? }
.max_by { |(_, weight)| rand ** (1.0 / weight) }
.first
end
def self.runners(path)