Compare commits

...
3 Commits
Author SHA1 Message Date
Benoit Daloze ac793fdd38 When setting $JAVA_HOME also add $JAVA_HOME/bin to PATH
* See discussion in https://github.com/rake-compiler/rake-compiler/pull/247
  it is messy if that's not the case and also creates inconsistencies
  based on which Java tool/executable is used.
2025-12-13 21:06:12 +01:00
Benoit Daloze 5f8a775744 macos-13 is gone 2025-12-11 22:51:44 +01:00
dependabot[bot] 30a6546035 Bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-11 22:47:42 +01:00
7 changed files with 50 additions and 44 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ jobs:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }} GH_REPO: ${{ github.repository }}
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: ./ - uses: ./
+21 -21
View File
@@ -17,7 +17,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm, macos-13, macos-14, macos-15, macos-15-intel, windows-2022, windows-2025, windows-11-arm ] os: [ ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm, macos-14, macos-15, macos-15-intel, windows-2022, windows-2025, windows-11-arm ]
ruby: [ 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', '3.4', '4.0', ruby-head, '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', '3.4', '4.0', ruby-head,
jruby-9.4, jruby, jruby-head, jruby-9.4, jruby, jruby-head,
@@ -100,7 +100,7 @@ jobs:
name: ${{ matrix.os }} ${{ matrix.ruby }} name: ${{ matrix.os }} ${{ matrix.ruby }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: ./ - uses: ./
with: with:
@@ -206,7 +206,7 @@ jobs:
name: "Test .ruby-version" name: "Test .ruby-version"
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- run: echo "ruby-3.4.0" > .ruby-version - run: echo "ruby-3.4.0" > .ruby-version
- uses: ./ - uses: ./
- run: ruby -v | grep -F "ruby 3.4.0" - run: ruby -v | grep -F "ruby 3.4.0"
@@ -215,7 +215,7 @@ jobs:
name: "Test .tool-versions" name: "Test .tool-versions"
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- run: echo -e "nodejs 16.0.0\nruby 3.4.0" > .tool-versions - run: echo -e "nodejs 16.0.0\nruby 3.4.0" > .tool-versions
- uses: ./ - uses: ./
- run: ruby -v | grep -F "ruby 3.4.0" - run: ruby -v | grep -F "ruby 3.4.0"
@@ -224,7 +224,7 @@ jobs:
name: "Test mise.toml" name: "Test mise.toml"
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- run: echo -e "[tools]\nnode = '18'\nruby = '3.4.0'" > mise.toml - run: echo -e "[tools]\nnode = '18'\nruby = '3.4.0'" > mise.toml
- uses: ./ - uses: ./
- run: ruby -v | grep -F "ruby 3.4.0" - run: ruby -v | grep -F "ruby 3.4.0"
@@ -233,7 +233,7 @@ jobs:
name: "Test with no Gemfile" name: "Test with no Gemfile"
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- run: rm Gemfile - run: rm Gemfile
- uses: ./ - uses: ./
with: with:
@@ -244,7 +244,7 @@ jobs:
name: "Test with no Gemfile but with bundler-cache" name: "Test with no Gemfile but with bundler-cache"
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- run: rm Gemfile - run: rm Gemfile
- uses: ./ - uses: ./
with: with:
@@ -267,7 +267,7 @@ jobs:
- { ruby: '2.3', expected_rubygems_version: '3.3.27' } - { ruby: '2.3', expected_rubygems_version: '3.3.27' }
- { ruby: '2.0', expected_rubygems_version: '2.7.11' } - { ruby: '2.0', expected_rubygems_version: '2.7.11' }
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: ./ - uses: ./
with: with:
ruby-version: ${{ matrix.ruby }} ruby-version: ${{ matrix.ruby }}
@@ -278,7 +278,7 @@ jobs:
name: "Test rubygems: version upgrades RubyGems to that version if the default is older" name: "Test rubygems: version upgrades RubyGems to that version if the default is older"
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: ./ - uses: ./
with: with:
ruby-version: '2.6' ruby-version: '2.6'
@@ -289,7 +289,7 @@ jobs:
name: "Test rubygems: version noops if the default is newer" name: "Test rubygems: version noops if the default is newer"
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: ./ - uses: ./
with: with:
ruby-version: '3.1.0' ruby-version: '3.1.0'
@@ -300,7 +300,7 @@ jobs:
name: "Test rubygems: version uses the Bundler installed by the rubygems update" name: "Test rubygems: version uses the Bundler installed by the rubygems update"
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: ./ - uses: ./
with: with:
ruby-version: '3.1.0' ruby-version: '3.1.0'
@@ -312,7 +312,7 @@ jobs:
name: "Test bundler: 1.x for old Ruby" name: "Test bundler: 1.x for old Ruby"
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: ./ - uses: ./
with: with:
ruby-version: '2.3' ruby-version: '2.3'
@@ -323,7 +323,7 @@ jobs:
name: "Test with a major Bundler version" name: "Test with a major Bundler version"
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: ./ - uses: ./
with: with:
ruby-version: '2.6' ruby-version: '2.6'
@@ -334,7 +334,7 @@ jobs:
name: "Test with a minor Bundler version" name: "Test with a minor Bundler version"
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: ./ - uses: ./
with: with:
ruby-version: '2.6' ruby-version: '2.6'
@@ -345,7 +345,7 @@ jobs:
name: "Test with an exact Bundler version" name: "Test with an exact Bundler version"
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: ./ - uses: ./
with: with:
ruby-version: '2.6' ruby-version: '2.6'
@@ -356,7 +356,7 @@ jobs:
name: "Test with a Bundler pre/rc version" name: "Test with a Bundler pre/rc version"
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: ./ - uses: ./
with: with:
ruby-version: '2.6' ruby-version: '2.6'
@@ -369,7 +369,7 @@ jobs:
env: env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/bundler-dev.gemfile BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/bundler-dev.gemfile
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: ./ - uses: ./
with: with:
ruby-version: ruby-head ruby-version: ruby-head
@@ -381,7 +381,7 @@ jobs:
env: env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/bundler1.gemfile BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/bundler1.gemfile
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: ./ - uses: ./
with: with:
ruby-version: '2.7' ruby-version: '2.7'
@@ -399,7 +399,7 @@ jobs:
env: env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: ./ - uses: ./
with: with:
ruby-version: '3.2' ruby-version: '3.2'
@@ -410,7 +410,7 @@ jobs:
name: "Test windows-toolchain: none" name: "Test windows-toolchain: none"
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: ./ - uses: ./
with: with:
ruby-version: '2.7' ruby-version: '2.7'
@@ -422,7 +422,7 @@ jobs:
lint: lint:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- run: yarn install - run: yarn install
- run: yarn run package - run: yarn run package
- name: Check generated files are up to date - name: Check generated files are up to date
+1 -1
View File
@@ -9,7 +9,7 @@ jobs:
update_branch: update_branch:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
with: with:
fetch-depth: 0 fetch-depth: 0
- run: git push origin HEAD:v1 - run: git push origin HEAD:v1
+1 -1
View File
@@ -50,7 +50,7 @@ The action works on these [GitHub-hosted runners](https://docs.github.com/en/act
| Operating System | Supported | | Operating System | Supported |
| ---------------- | --------- | | ---------------- | --------- |
| Ubuntu | `ubuntu-22.04`, `ubuntu-24.04`, `ubuntu-22.04-arm`, `ubuntu-24.04-arm` | | Ubuntu | `ubuntu-22.04`, `ubuntu-24.04`, `ubuntu-22.04-arm`, `ubuntu-24.04-arm` |
| macOS | `macos-13` and newer versions | | macOS | `macos-14` and newer versions |
| Windows | `windows-2022`, `windows-2025`, `windows-11-arm` | | Windows | `windows-2022`, `windows-2025`, `windows-11-arm` |
Not all combinations of runner images and versions are supported. Not all combinations of runner images and versions are supported.
+10 -7
View File
@@ -13,6 +13,7 @@ const linuxOSInfo = require('linux-os-info')
export const windows = (os.platform() === 'win32') export const windows = (os.platform() === 'win32')
// Extract to SSD on Windows, see https://github.com/ruby/setup-ruby/pull/14 // Extract to SSD on Windows, see https://github.com/ruby/setup-ruby/pull/14
export const drive = (windows ? (process.env['RUNNER_TEMP'] || 'C')[0] : undefined) export const drive = (windows ? (process.env['RUNNER_TEMP'] || 'C')[0] : undefined)
const PATH_ENV_VAR = windows ? 'Path' : 'PATH'
export const inputs = { export const inputs = {
selfHosted: undefined selfHosted: undefined
@@ -365,23 +366,22 @@ export function win2nix(path) {
} }
export function setupPath(newPathEntries) { export function setupPath(newPathEntries) {
const envPath = windows ? 'Path' : 'PATH' const originalPath = process.env[PATH_ENV_VAR].split(path.delimiter)
const originalPath = process.env[envPath].split(path.delimiter)
let cleanPath = originalPath.filter(entry => !/\bruby\b/i.test(entry)) let cleanPath = originalPath.filter(entry => !/\bruby\b/i.test(entry))
core.group(`Modifying ${envPath}`, async () => { core.group(`Modifying ${PATH_ENV_VAR}`, async () => {
// First remove the conflicting path entries // First remove the conflicting path entries
if (cleanPath.length !== originalPath.length) { if (cleanPath.length !== originalPath.length) {
console.log(`Entries removed from ${envPath} to avoid conflicts with default Ruby:`) console.log(`Entries removed from ${PATH_ENV_VAR} to avoid conflicts with default Ruby:`)
for (const entry of originalPath) { for (const entry of originalPath) {
if (!cleanPath.includes(entry)) { if (!cleanPath.includes(entry)) {
console.log(` ${entry}`) console.log(` ${entry}`)
} }
} }
core.exportVariable(envPath, cleanPath.join(path.delimiter)) core.exportVariable(PATH_ENV_VAR, cleanPath.join(path.delimiter))
} }
console.log(`Entries added to ${envPath} to use selected Ruby:`) console.log(`Entries added to ${PATH_ENV_VAR} to use selected Ruby:`)
for (const entry of newPathEntries) { for (const entry of newPathEntries) {
console.log(` ${entry}`) console.log(` ${entry}`)
} }
@@ -415,14 +415,17 @@ export async function setupJavaHome(rubyPrefix) {
// JAVA_HOME_21_X64 - https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md#java // JAVA_HOME_21_X64 - https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md#java
let newHomeVar = `JAVA_HOME_21_${arch}` let newHomeVar = `JAVA_HOME_21_${arch}`
let newHome = process.env[newHomeVar] let newHome = process.env[newHomeVar]
let bin = path.join(newHome, 'bin')
if (newHome === "undefined") { if (newHome === "undefined") {
throw new Error(`JAVA_HOME is not Java 21+ needed for JRuby and \$${newHomeVar} is not defined`) throw new Error(`JAVA_HOME is not Java 21+ needed for JRuby and \$${newHomeVar} is not defined`)
} }
console.log(`Setting JAVA_HOME to ${newHomeVar} path ${newHome}`) console.log(`Setting JAVA_HOME to ${newHomeVar} path ${newHome}`)
core.exportVariable("JAVA_HOME", newHome) core.exportVariable("JAVA_HOME", newHome)
console.log(`Adding ${bin} to ${PATH_ENV_VAR}`)
core.addPath(bin)
} }
}) })
} }
Generated Vendored
+13 -10
View File
@@ -344,6 +344,7 @@ const linuxOSInfo = __nccwpck_require__(962)
const windows = (os.platform() === 'win32') const windows = (os.platform() === 'win32')
// Extract to SSD on Windows, see https://github.com/ruby/setup-ruby/pull/14 // Extract to SSD on Windows, see https://github.com/ruby/setup-ruby/pull/14
const drive = (windows ? (process.env['RUNNER_TEMP'] || 'C')[0] : undefined) const drive = (windows ? (process.env['RUNNER_TEMP'] || 'C')[0] : undefined)
const PATH_ENV_VAR = windows ? 'Path' : 'PATH'
const inputs = { const inputs = {
selfHosted: undefined selfHosted: undefined
@@ -696,23 +697,22 @@ function win2nix(path) {
} }
function setupPath(newPathEntries) { function setupPath(newPathEntries) {
const envPath = windows ? 'Path' : 'PATH' const originalPath = process.env[PATH_ENV_VAR].split(path.delimiter)
const originalPath = process.env[envPath].split(path.delimiter)
let cleanPath = originalPath.filter(entry => !/\bruby\b/i.test(entry)) let cleanPath = originalPath.filter(entry => !/\bruby\b/i.test(entry))
core.group(`Modifying ${envPath}`, async () => { core.group(`Modifying ${PATH_ENV_VAR}`, async () => {
// First remove the conflicting path entries // First remove the conflicting path entries
if (cleanPath.length !== originalPath.length) { if (cleanPath.length !== originalPath.length) {
console.log(`Entries removed from ${envPath} to avoid conflicts with default Ruby:`) console.log(`Entries removed from ${PATH_ENV_VAR} to avoid conflicts with default Ruby:`)
for (const entry of originalPath) { for (const entry of originalPath) {
if (!cleanPath.includes(entry)) { if (!cleanPath.includes(entry)) {
console.log(` ${entry}`) console.log(` ${entry}`)
} }
} }
core.exportVariable(envPath, cleanPath.join(path.delimiter)) core.exportVariable(PATH_ENV_VAR, cleanPath.join(path.delimiter))
} }
console.log(`Entries added to ${envPath} to use selected Ruby:`) console.log(`Entries added to ${PATH_ENV_VAR} to use selected Ruby:`)
for (const entry of newPathEntries) { for (const entry of newPathEntries) {
console.log(` ${entry}`) console.log(` ${entry}`)
} }
@@ -746,14 +746,17 @@ async function setupJavaHome(rubyPrefix) {
// JAVA_HOME_21_X64 - https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md#java // JAVA_HOME_21_X64 - https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md#java
let newHomeVar = `JAVA_HOME_21_${arch}` let newHomeVar = `JAVA_HOME_21_${arch}`
let newHome = process.env[newHomeVar] let newHome = process.env[newHomeVar]
let bin = path.join(newHome, 'bin')
if (newHome === "undefined") { if (newHome === "undefined") {
throw new Error(`JAVA_HOME is not Java 21+ needed for JRuby and \$${newHomeVar} is not defined`) throw new Error(`JAVA_HOME is not Java 21+ needed for JRuby and \$${newHomeVar} is not defined`)
} }
console.log(`Setting JAVA_HOME to ${newHomeVar} path ${newHome}`) console.log(`Setting JAVA_HOME to ${newHomeVar} path ${newHome}`)
core.exportVariable("JAVA_HOME", newHome) core.exportVariable("JAVA_HOME", newHome)
console.log(`Adding ${bin} to ${PATH_ENV_VAR}`)
core.addPath(bin)
} }
}) })
} }
@@ -85453,7 +85456,7 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe
// Well known version-platform combinations which do not work: // Well known version-platform combinations which do not work:
if (engine === 'ruby' && platform.startsWith('macos') && os.arch() === 'arm64' && common.floatVersion(version) < 2.6) { if (engine === 'ruby' && platform.startsWith('macos') && os.arch() === 'arm64' && common.floatVersion(version) < 2.6) {
throw new Error(`CRuby < 2.6 does not support macos-arm64. throw new Error(`CRuby < 2.6 does not support macos-arm64.
Either use a newer Ruby version or use a macOS image running on amd64, e.g., macos-13. Either use a newer Ruby version or use a macOS image running on amd64, e.g., macos-15-intel.
Note that GitHub changed the meaning of macos-latest from macos-12 (amd64) to macos-14 (arm64): Note that GitHub changed the meaning of macos-latest from macos-12 (amd64) to macos-14 (arm64):
https://github.blog/changelog/2024-04-01-macos-14-sonoma-is-generally-available-and-the-latest-macos-runner-image/ https://github.blog/changelog/2024-04-01-macos-14-sonoma-is-generally-available-and-the-latest-macos-runner-image/
@@ -85466,8 +85469,8 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe
- { os: macos-latest, ruby: '2.4' } - { os: macos-latest, ruby: '2.4' }
- { os: macos-latest, ruby: '2.5' } - { os: macos-latest, ruby: '2.5' }
include: include:
- { os: macos-13, ruby: '2.4' } - { os: macos-15-intel, ruby: '2.4' }
- { os: macos-13, ruby: '2.5' } - { os: macos-15-intel, ruby: '2.5' }
But of course you should consider dropping support for these long-EOL Rubies, which cannot even be built on recent macOS machines.`) But of course you should consider dropping support for these long-EOL Rubies, which cannot even be built on recent macOS machines.`)
} else if (engine === 'truffleruby' && platform.startsWith('windows')) { } else if (engine === 'truffleruby' && platform.startsWith('windows')) {
+3 -3
View File
@@ -175,7 +175,7 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe
// Well known version-platform combinations which do not work: // Well known version-platform combinations which do not work:
if (engine === 'ruby' && platform.startsWith('macos') && os.arch() === 'arm64' && common.floatVersion(version) < 2.6) { if (engine === 'ruby' && platform.startsWith('macos') && os.arch() === 'arm64' && common.floatVersion(version) < 2.6) {
throw new Error(`CRuby < 2.6 does not support macos-arm64. throw new Error(`CRuby < 2.6 does not support macos-arm64.
Either use a newer Ruby version or use a macOS image running on amd64, e.g., macos-13. Either use a newer Ruby version or use a macOS image running on amd64, e.g., macos-15-intel.
Note that GitHub changed the meaning of macos-latest from macos-12 (amd64) to macos-14 (arm64): Note that GitHub changed the meaning of macos-latest from macos-12 (amd64) to macos-14 (arm64):
https://github.blog/changelog/2024-04-01-macos-14-sonoma-is-generally-available-and-the-latest-macos-runner-image/ https://github.blog/changelog/2024-04-01-macos-14-sonoma-is-generally-available-and-the-latest-macos-runner-image/
@@ -188,8 +188,8 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe
- { os: macos-latest, ruby: '2.4' } - { os: macos-latest, ruby: '2.4' }
- { os: macos-latest, ruby: '2.5' } - { os: macos-latest, ruby: '2.5' }
include: include:
- { os: macos-13, ruby: '2.4' } - { os: macos-15-intel, ruby: '2.4' }
- { os: macos-13, ruby: '2.5' } - { os: macos-15-intel, ruby: '2.5' }
But of course you should consider dropping support for these long-EOL Rubies, which cannot even be built on recent macOS machines.`) But of course you should consider dropping support for these long-EOL Rubies, which cannot even be built on recent macOS machines.`)
} else if (engine === 'truffleruby' && platform.startsWith('windows')) { } else if (engine === 'truffleruby' && platform.startsWith('windows')) {