Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Library/Homebrew/dev-cmd/dispatch-build-bottle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ def run
end

if args.linux?
runners << "ubuntu-22.04"
runners << "ubuntu-latest"
elsif args.linux_self_hosted?
runners << "linux-self-hosted-1"
end

runners << "ubuntu-22.04-arm" if args.linux_arm64?
runners << OS::LINUX_CI_ARM_RUNNER if args.linux_arm64?

if runners.empty?
raise UsageError, "Must specify `--macos`, `--linux`, `--linux-arm64`, or `--linux-self-hosted` option."
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/dev-cmd/generate-cask-ci-matrix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ class GenerateCaskCiMatrix < AbstractCommand
{ symbol: :sequoia, name: "macos-15-intel", arch: :intel } => 1.0,
}.freeze, T::Hash[T::Hash[Symbol, T.any(Symbol, String)], Float])
X86_LINUX_RUNNERS = T.let({
{ symbol: :linux, name: "ubuntu-22.04", arch: :intel } => 1.0,
{ symbol: :linux, name: "ubuntu-latest", arch: :intel } => 1.0,
}.freeze, T::Hash[T::Hash[Symbol, T.any(Symbol, String)], Float])
ARM_MACOS_RUNNERS = T.let({
{ symbol: :sonoma, name: "macos-14", arch: :arm } => 0.0,
{ symbol: :sequoia, name: "macos-15", arch: :arm } => 0.0,
{ symbol: :tahoe, name: "macos-26", arch: :arm } => 1.0,
}.freeze, T::Hash[T::Hash[Symbol, T.any(Symbol, String)], Float])
ARM_LINUX_RUNNERS = T.let({
{ symbol: :linux, name: "ubuntu-22.04-arm", arch: :arm } => 1.0,
{ symbol: :linux, name: OS::LINUX_CI_ARM_RUNNER, arch: :arm } => 1.0,
}.freeze, T::Hash[T::Hash[Symbol, T.any(Symbol, String)], Float])
MACOS_RUNNERS = T.let(X86_MACOS_RUNNERS.merge(ARM_MACOS_RUNNERS).freeze,
T::Hash[T::Hash[Symbol, T.any(Symbol, String)], Float])
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/github_runner_matrix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def active_runner_specs_hash
sig { params(arch: Symbol).returns(LinuxRunnerSpec) }
def linux_runner_spec(arch)
linux_runner = case arch
when :arm64 then "ubuntu-22.04-arm"
when :arm64 then OS::LINUX_CI_ARM_RUNNER
when :x86_64 then ENV.fetch("HOMEBREW_LINUX_RUNNER", "ubuntu-latest")
else raise "Unknown Linux architecture: #{arch}"
end
Expand Down
1 change: 1 addition & 0 deletions Library/Homebrew/os.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def self.kernel_name

# See Linux-CI.md
LINUX_CI_OS_VERSION = "Ubuntu 22.04"
LINUX_CI_ARM_RUNNER = "ubuntu-22.04-arm"
LINUX_GLIBC_CI_VERSION = "2.35"
LINUX_GLIBC_NEXT_CI_VERSION = "2.39" # users below this version will be warned by `brew doctor`
LINUX_GCC_CI_VERSION = "12" # https://packages.ubuntu.com/jammy/gcc-12
Expand Down
5 changes: 3 additions & 2 deletions Library/Homebrew/test/dev-cmd/determine-test-runners_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def get_runners(file)
FileUtils.rm_f github_output
end

let(:linux_runner) { "ubuntu-22.04" }
let(:arm_linux_runner) { OS::LINUX_CI_ARM_RUNNER }
let(:linux_runner) { "ubuntu-latest" }
# We need to make sure we write to a different path for each example.
let(:github_output) { "#{TEST_TMPDIR}/github_output#{DetermineRunnerTestHelper.new.number}" }
let(:ephemeral_suffix) { "-12345" }
Expand All @@ -41,7 +42,7 @@ def get_runners(file)
end

out << linux_runner
out << "#{linux_runner}-arm"
out << arm_linux_runner

out
end
Expand Down
23 changes: 12 additions & 11 deletions Library/Homebrew/test/dev-cmd/generate-cask-ci-matrix_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
it_behaves_like "parseable arguments"

describe "::filter_runners" do
let(:arm_linux_runner) { OS::LINUX_CI_ARM_RUNNER }
# We simulate a macOS version older than the newest, as the method will use
# the host macOS version instead of the default (the newest macOS version).
let(:older_macos) { :big_sur }
Expand All @@ -153,19 +154,19 @@
{ arch: :arm, name: "macos-14", symbol: :sonoma } => 0.0,
{ arch: :arm, name: "macos-15", symbol: :sequoia } => 0.0,
{ arch: :arm, name: "macos-26", symbol: :tahoe } => 1.0,
{ arch: :arm, name: "ubuntu-22.04-arm", symbol: :linux } => 1.0,
{ arch: :arm, name: arm_linux_runner, symbol: :linux } => 1.0,
{ arch: :intel, name: "macos-15-intel", symbol: :sequoia } => 1.0,
{ arch: :intel, name: "ubuntu-22.04", symbol: :linux } => 1.0,
{ arch: :intel, name: "ubuntu-latest", symbol: :linux } => 1.0,
})

expect(generate_matrix.filter_runners(c_app_only_macos))
.to eq({
{ arch: :arm, name: "macos-14", symbol: :sonoma } => 0.0,
{ arch: :arm, name: "macos-15", symbol: :sequoia } => 0.0,
{ arch: :arm, name: "macos-26", symbol: :tahoe } => 1.0,
{ arch: :arm, name: "ubuntu-22.04-arm", symbol: :linux } => 1.0,
{ arch: :arm, name: arm_linux_runner, symbol: :linux } => 1.0,
{ arch: :intel, name: "macos-15-intel", symbol: :sequoia } => 1.0,
{ arch: :intel, name: "ubuntu-22.04", symbol: :linux } => 1.0,
{ arch: :intel, name: "ubuntu-latest", symbol: :linux } => 1.0,
})
end
end
Expand Down Expand Up @@ -196,9 +197,9 @@
{ arch: :arm, name: "macos-14", symbol: :sonoma } => 0.0,
{ arch: :arm, name: "macos-15", symbol: :sequoia } => 0.0,
{ arch: :arm, name: "macos-26", symbol: :tahoe } => 1.0,
{ arch: :arm, name: "ubuntu-22.04-arm", symbol: :linux } => 1.0,
{ arch: :arm, name: arm_linux_runner, symbol: :linux } => 1.0,
{ arch: :intel, name: "macos-15-intel", symbol: :sequoia } => 1.0,
{ arch: :intel, name: "ubuntu-22.04", symbol: :linux } => 1.0,
{ arch: :intel, name: "ubuntu-latest", symbol: :linux } => 1.0,
})
end
end
Expand All @@ -208,7 +209,7 @@
expect(generate_matrix.filter_runners(c_on_system_depends_on_intel))
.to eq({
{ arch: :intel, name: "macos-15-intel", symbol: :sequoia } => 1.0,
{ arch: :intel, name: "ubuntu-22.04", symbol: :linux } => 1.0,
{ arch: :intel, name: "ubuntu-latest", symbol: :linux } => 1.0,
})

expect(generate_matrix.filter_runners(c_on_linux_depends_on_intel))
Expand All @@ -217,19 +218,19 @@
{ arch: :arm, name: "macos-15", symbol: :sequoia } => 0.0,
{ arch: :arm, name: "macos-26", symbol: :tahoe } => 1.0,
{ arch: :intel, name: "macos-15-intel", symbol: :sequoia } => 1.0,
{ arch: :intel, name: "ubuntu-22.04", symbol: :linux } => 1.0,
{ arch: :intel, name: "ubuntu-latest", symbol: :linux } => 1.0,
})

expect(generate_matrix.filter_runners(c_on_macos_depends_on_intel))
.to eq({
{ arch: :intel, name: "macos-15-intel", symbol: :sequoia } => 1.0,
{ arch: :intel, name: "ubuntu-22.04", symbol: :linux } => 1.0,
{ arch: :arm, name: "ubuntu-22.04-arm", symbol: :linux } => 1.0,
{ arch: :intel, name: "ubuntu-latest", symbol: :linux } => 1.0,
{ arch: :arm, name: arm_linux_runner, symbol: :linux } => 1.0,
})

expect(generate_matrix.filter_runners(c_on_system_depends_on_mixed))
.to eq({
{ arch: :arm, name: "ubuntu-22.04-arm", symbol: :linux } => 1.0,
{ arch: :arm, name: arm_linux_runner, symbol: :linux } => 1.0,
{ arch: :intel, name: "macos-15-intel", symbol: :sequoia } => 1.0,
})
end
Expand Down
Loading