Refactor matrix script

This commit is contained in:
なつき
2026-03-27 23:08:30 +00:00
parent 2327de0bdc
commit ba696adf55
+2 -3
View File
@@ -33,9 +33,8 @@ runners = %w[
macos_runners = runners.select { |runner| runner.start_with?('macos-') }
ubuntu_runners = runners.select { |runner| runner.start_with?('ubuntu-') }
windows_runners, non_windows_runners = runners.partition { |runner| runner.start_with?('windows-') }
macos_intel_runners = runners.grep(/macos.+intel/)
macos_arm64_runners, _macos_x64_runners = macos_runners.partition { |runner| !runner.end_with?('-intel')}
macos_arm64_runners, macos_x64_runners = macos_runners.partition { |runner| !runner.end_with?('-intel')}
ubuntu_arm64_runners, ubuntu_x64_runners = ubuntu_runners.partition { |runner| runner.end_with?('-arm')}
windows_arm64_runners, windows_x64_runners = windows_runners.partition { |runner| runner.end_with?('-arm') }
@@ -75,6 +74,6 @@ matrix -= ubuntu_arm64_runners.product(%w[1.9 2.0 2.1 2.2])
# RubyInstaller windows-arm64 builds only exist for Ruby 3.4+
matrix -= windows_arm64_runners.product(%w[2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 3.0 3.1 3.2 3.3])
# TruffleRuby 34+ does not support macOS Intel
matrix -= macos_intel_runners.product(%w[truffleruby-head truffleruby+graalvm-head])
matrix -= macos_x64_runners.product(%w[truffleruby-head truffleruby+graalvm-head])
puts(JSON.generate(matrix.sort.map { |os, ruby| { os:, ruby: } }))