@@ -83,9 +83,13 @@ def active_runner_specs_hash
83
83
GITHUB_ACTIONS_SHORT_TIMEOUT = 60
84
84
private_constant :SELF_HOSTED_LINUX_RUNNER , :GITHUB_ACTIONS_LONG_TIMEOUT , :GITHUB_ACTIONS_SHORT_TIMEOUT
85
85
86
- sig { returns ( LinuxRunnerSpec ) }
87
- def linux_runner_spec
88
- linux_runner = ENV . fetch ( "HOMEBREW_LINUX_RUNNER" )
86
+ sig { params ( arch : Symbol ) . returns ( LinuxRunnerSpec ) }
87
+ def linux_runner_spec ( arch )
88
+ linux_runner = case arch
89
+ when :arm64 then "ubuntu-22.04-arm"
90
+ when :x86_64 then ENV . fetch ( "HOMEBREW_LINUX_RUNNER" )
91
+ else raise "Unknown Linux architecture: #{ arch } "
92
+ end
89
93
90
94
LinuxRunnerSpec . new (
91
95
name : "Linux" ,
@@ -108,14 +112,16 @@ def linux_runner_spec
108
112
params (
109
113
platform : Symbol ,
110
114
arch : Symbol ,
111
- spec : RunnerSpec ,
115
+ spec : T . nilable ( RunnerSpec ) ,
112
116
macos_version : T . nilable ( MacOSVersion ) ,
113
117
) . returns ( GitHubRunner )
114
118
}
115
- def create_runner ( platform , arch , spec , macos_version = nil )
119
+ def create_runner ( platform , arch , spec = nil , macos_version = nil )
116
120
raise "Unexpected platform: #{ platform } " if VALID_PLATFORMS . exclude? ( platform )
117
121
raise "Unexpected arch: #{ arch } " if VALID_ARCHES . exclude? ( arch )
122
+ raise "Missing `spec` argument" if spec . nil? && platform != :linux
118
123
124
+ spec ||= linux_runner_spec ( arch )
119
125
runner = GitHubRunner . new ( platform :, arch :, spec :, macos_version :)
120
126
runner . spec . testing_formulae += testable_formulae ( runner )
121
127
runner . active = active_runner? ( runner )
@@ -141,7 +147,12 @@ def generate_runners!
141
147
return if @runners . present?
142
148
143
149
if !@all_supported || ENV . key? ( "HOMEBREW_LINUX_RUNNER" )
144
- @runners << create_runner ( :linux , :x86_64 , linux_runner_spec )
150
+ @runners << create_runner ( :linux , :x86_64 )
151
+
152
+ if !@dependent_matrix &&
153
+ @testing_formulae . any? { |tf | tf . formula . bottle_specification . tag? ( Utils ::Bottles . tag ( :arm64_linux ) ) }
154
+ @runners << create_runner ( :linux , :arm64 )
155
+ end
145
156
end
146
157
147
158
github_run_id = ENV . fetch ( "GITHUB_RUN_ID" )
@@ -184,7 +195,11 @@ def generate_runners!
184
195
)
185
196
@runners << create_runner ( :macos , :arm64 , spec , macos_version )
186
197
187
- next if !@all_supported && macos_version > NEWEST_HOMEBREW_CORE_INTEL_MACOS_RUNNER
198
+ skip_intel_runner = !@all_supported && macos_version > NEWEST_HOMEBREW_CORE_INTEL_MACOS_RUNNER
199
+ skip_intel_runner &&= @dependent_matrix || @testing_formulae . none? do |testing_formula |
200
+ testing_formula . formula . bottle_specification . tag? ( Utils ::Bottles . tag ( macos_version . to_sym ) )
201
+ end
202
+ next if skip_intel_runner
188
203
189
204
github_runner_available = macos_version . between? ( OLDEST_GITHUB_ACTIONS_INTEL_MACOS_RUNNER ,
190
205
NEWEST_GITHUB_ACTIONS_INTEL_MACOS_RUNNER )
0 commit comments