Skip to content

Commit

Permalink
Add support for macos-13-arm64 GitHub runners
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Oct 11, 2023
1 parent f887fb3 commit 5cfe23c
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 9 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, macos-13, windows-2019, windows-2022 ]
os: [ ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, macos-13, macos-arm-oss, windows-2019, windows-2022 ]
ruby: [
'1.9', '2.0', '2.1', '2.2', '2.3', '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3', ruby-head,
jruby, jruby-head,
Expand All @@ -31,7 +31,22 @@ jobs:
- { os: windows-2022, ruby: mswin }
- { os: windows-2022, ruby: ucrt }
exclude:
- { os: ubuntu-22.04, ruby: '2.2' } # https://github.com/ruby/setup-ruby/issues/496
# https://github.com/ruby/setup-ruby/issues/496
- { os: ubuntu-22.04, ruby: '2.2' }
# Too old, fails to compile on macos-arm-oss
- { os: macos-arm-oss, ruby: '1.9' }
- { os: macos-arm-oss, ruby: '2.0' }
- { os: macos-arm-oss, ruby: '2.1' }
- { os: macos-arm-oss, ruby: '2.2' }
- { os: macos-arm-oss, ruby: '2.3' }
- { os: macos-arm-oss, ruby: '2.4' }
- { os: macos-arm-oss, ruby: '2.5' }
# Fails to compile on macos-arm-oss, https://github.com/ruby/setup-ruby/pull/494#issuecomment-1758099885
- { os: macos-arm-oss, ruby: '3.1' }
# No Java available yet on macos-arm-oss images
- { os: macos-arm-oss, ruby: 'jruby' }
- { os: macos-arm-oss, ruby: 'jruby-head' }
# Windows
- { os: windows-2019, ruby: '1.9' }
- { os: windows-2019, ruby: '3.3' }
- { os: windows-2019, ruby: debug }
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The action works on these [GitHub-hosted runners](https://docs.github.com/en/act
| Operating System | Supported |
| ---------------- | --------- |
| Ubuntu | `ubuntu-20.04`, `ubuntu-22.04` |
| macOS | `macos-11`, `macos-12`, `macos-13` |
| macOS | `macos-11`, `macos-12`, `macos-13`, `macos-13-xlarge` (arm64) |
| Windows | `windows-2019`, `windows-2022` |

The prebuilt releases are generated by [ruby-builder](https://github.com/ruby/ruby-builder)
Expand Down
3 changes: 2 additions & 1 deletion common.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ const GitHubHostedPlatforms = [
'macos-11-x64',
'macos-12-x64',
'macos-13-x64',
'macos-13-arm64',
'windows-2019-x64',
'windows-2022-x64',
]
Expand Down Expand Up @@ -243,7 +244,7 @@ export function getToolCachePath() {
return getRunnerToolCache()
} else {
// Rubies prebuilt by this action embed this path rather than using $RUNNER_TOOL_CACHE
// so use that path is not isSelfHostedRunner()
// so use that path if not isSelfHostedRunner()
return getDefaultToolCachePath()
}
}
Expand Down
11 changes: 8 additions & 3 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions ruby-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,14 @@ async function downloadAndExtract(platform, engine, version, rubyPrefix) {

function getDownloadURL(platform, engine, version) {
let builderPlatform = platform
if (platform.startsWith('windows-')) {
if (platform.startsWith('windows-') && os.arch() === 'x64') {
builderPlatform = 'windows-latest'
} else if (platform.startsWith('macos-')) {
builderPlatform = 'macos-latest'
if (os.arch() === 'x64') {
builderPlatform = 'macos-latest'
} else if (os.arch() === 'arm64') {
builderPlatform = 'macos-13-arm64'
}
}

if (common.isHeadVersion(version)) {
Expand Down

0 comments on commit 5cfe23c

Please sign in to comment.