github_runner_matrix: emulate plaform when sending compatible? requests

Signed-off-by: botantony <antonsm21@gmail.com>
This commit is contained in:
botantony 2025-05-01 23:25:23 +02:00
parent bbac5be4d3
commit d8144ce5e3
No known key found for this signature in database
GPG Key ID: 7FE721557EA6AAD6

View File

@ -255,8 +255,18 @@ class GitHubRunnerMatrix
@testing_formulae.select do |formula|
next false if macos_version && !formula.compatible_with?(macos_version)
formula.public_send(:"#{platform}_compatible?") &&
formula.public_send(:"#{arch}_compatible?")
simulate_arch = case arch
when :x86_64
:intel
when :arm64
:arm
else
:dunno
end
Homebrew::SimulateSystem.with(os: platform, arch: simulate_arch) do
formula.public_send(:"#{platform}_compatible?") &&
formula.public_send(:"#{arch}_compatible?")
end
end
end
end