mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 22:44:20 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad65390c0a | ||
|
|
c5c7583a68 | ||
|
|
117edf3c27 | ||
|
|
df8f44e55c | ||
|
|
2b7bafee36 | ||
|
|
dddacd7ec1 | ||
|
|
5ee10197cf | ||
|
|
4f47b3664d | ||
|
|
b97fdb9941 | ||
|
|
0a19fc237d | ||
|
|
745f03fc1c | ||
|
|
51b5bc2e0e | ||
|
|
034294ac91 | ||
|
|
b818bea8cf | ||
|
|
4281753149 | ||
|
|
7b5a90250e | ||
|
|
e90803a1bf | ||
|
|
fdcfbcf14e |
@@ -10,10 +10,11 @@ assignees: ''
|
|||||||
<!--
|
<!--
|
||||||
Before filing this issue:
|
Before filing this issue:
|
||||||
* If the issue happens on JRuby or TruffleRuby, and does not happen on CRuby (please check), file an issue there instead. It's very unlikely ruby/setup-ruby is the cause.
|
* If the issue happens on JRuby or TruffleRuby, and does not happen on CRuby (please check), file an issue there instead. It's very unlikely ruby/setup-ruby is the cause.
|
||||||
* Try to reproduce the issue locally by following the workflow steps (including all all commands done by ruby/setup-ruby, except for `Downloading Ruby` & `Extracting Ruby`). If it does reproduce locally, it's not a ruby/setup-ruby issue.
|
* Try to reproduce the issue locally by following the workflow steps (including all commands done by ruby/setup-ruby, except for `Downloading Ruby` & `Extracting Ruby`). If it does reproduce locally, it's not a ruby/setup-ruby issue.
|
||||||
|
|
||||||
Please provide:
|
Please provide:
|
||||||
* the code of or a link to the workflow used
|
* the code of or a link to the workflow used
|
||||||
* the link to the log of a failed workflow job
|
* the link to the log of a failed workflow job
|
||||||
* the command and output of the step failing
|
* the command and output of the step failing
|
||||||
|
* whether you are using a self-hosted runner
|
||||||
-->
|
-->
|
||||||
|
|||||||
@@ -95,9 +95,10 @@ jobs:
|
|||||||
- name: bash test
|
- name: bash test
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo ~
|
run: echo ~
|
||||||
- name: Windows JRuby
|
# Disabled until https://github.com/jruby/jruby/issues/6648 is fixed
|
||||||
if: startsWith(matrix.os, 'windows') && startsWith(matrix.ruby, 'jruby')
|
# - name: Windows JRuby
|
||||||
run: gem install sassc -N
|
# if: startsWith(matrix.os, 'windows') && startsWith(matrix.ruby, 'jruby')
|
||||||
|
# run: gem install sassc -N
|
||||||
|
|
||||||
testExactBundlerVersion:
|
testExactBundlerVersion:
|
||||||
name: "Test with an exact Bundler version"
|
name: "Test with an exact Bundler version"
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ This action currently supports these versions of MRI, JRuby and TruffleRuby:
|
|||||||
| Interpreter | Versions |
|
| Interpreter | Versions |
|
||||||
| ----------- | -------- |
|
| ----------- | -------- |
|
||||||
| `ruby` | 2.1.9, 2.2, 2.3.0 - 2.3.8, 2.4.0 - 2.4.10, 2.5.0 - 2.5.8, 2.6.0 - 2.6.6, 2.7.2, 3.0.0, head, debug, mingw, mswin |
|
| `ruby` | 2.1.9, 2.2, 2.3.0 - 2.3.8, 2.4.0 - 2.4.10, 2.5.0 - 2.5.8, 2.6.0 - 2.6.6, 2.7.2, 3.0.0, head, debug, mingw, mswin |
|
||||||
| `jruby` | 9.1.17.0, 9.2.9.0 - 9.2.13.0, head |
|
| `jruby` | 9.1.17.0, 9.2.9.0 - 9.2.17.0, head |
|
||||||
| `truffleruby` | 19.3.0 - 21.0.0, head |
|
| `truffleruby` | 19.3.0 - 21.0.0, head |
|
||||||
|
|
||||||
`ruby-debug` is the same as `ruby-head` but with assertions enabled (`-DRUBY_DEBUG=1`).
|
`ruby-debug` is the same as `ruby-head` but with assertions enabled (`-DRUBY_DEBUG=1`).
|
||||||
@@ -38,7 +38,7 @@ The action works for all [GitHub-hosted runners](https://help.github.com/en/acti
|
|||||||
|
|
||||||
| Operating System | Recommended | Other Supported Versions |
|
| Operating System | Recommended | Other Supported Versions |
|
||||||
| ----------- | -------- | -------- |
|
| ----------- | -------- | -------- |
|
||||||
| Ubuntu | `ubuntu-latest` (= `ubuntu-18.04`) | `ubuntu-20.04`, `ubuntu-16.04` |
|
| Ubuntu | `ubuntu-latest` (= `ubuntu-20.04`) | `ubuntu-18.04`, `ubuntu-16.04` |
|
||||||
| macOS | `macos-latest` (= `macos-10.15`) | `macos-11.0` |
|
| macOS | `macos-latest` (= `macos-10.15`) | `macos-11.0` |
|
||||||
| Windows | `windows-latest` (= `windows-2019`) | `windows-2016` |
|
| Windows | `windows-latest` (= `windows-2019`) | `windows-2016` |
|
||||||
|
|
||||||
@@ -83,6 +83,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macos-latest]
|
os: [ubuntu-latest, macos-latest]
|
||||||
|
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
|
||||||
ruby: [2.5, 2.6, 2.7, '3.0', head, jruby, jruby-head, truffleruby, truffleruby-head]
|
ruby: [2.5, 2.6, 2.7, '3.0', head, jruby, jruby-head, truffleruby, truffleruby-head]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
@@ -110,7 +111,7 @@ jobs:
|
|||||||
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
|
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: ./
|
- uses: ruby/setup-ruby@v1
|
||||||
with:
|
with:
|
||||||
ruby-version: 2.6
|
ruby-version: 2.6
|
||||||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
||||||
@@ -166,8 +167,9 @@ as shown in the [example](#matrix-of-gemfiles).
|
|||||||
|
|
||||||
When using `bundler-cache: true` you might notice there is no good place to run `bundle config ...` commands.
|
When using `bundler-cache: true` you might notice there is no good place to run `bundle config ...` commands.
|
||||||
These can be replaced by `BUNDLE_*` environment variables, which are also faster.
|
These can be replaced by `BUNDLE_*` environment variables, which are also faster.
|
||||||
They should be set the `env` at the job level as shown in the [example](#matrix-of-gemfiles).
|
They should be set in the `env` at the job level as shown in the [example](#matrix-of-gemfiles).
|
||||||
See the [Bundler docs](https://bundler.io/man/bundle-config.1.html) or look at `.bundle/config` locally for the environment variable names,
|
To find the correct the environment variable name, see the [Bundler docs](https://bundler.io/man/bundle-config.1.html) or look at `.bundle/config` after running `bundle config --local KEY VALUE` locally.
|
||||||
|
You might need to `"`-quote the environment variable name in YAML if it has unusual characters like `/`.
|
||||||
|
|
||||||
To perform caching, this action will use `bundle config --local path $PWD/vendor/bundle`.
|
To perform caching, this action will use `bundle config --local path $PWD/vendor/bundle`.
|
||||||
Therefore, the Bundler `path` should not be changed in your workflow for the cache to work (no `bundle config path`).
|
Therefore, the Bundler `path` should not be changed in your workflow for the cache to work (no `bundle config path`).
|
||||||
@@ -214,7 +216,7 @@ This action might work with [self-hosted runners](https://docs.github.com/en/act
|
|||||||
if the [virtual environment](https://github.com/actions/virtual-environments) is very similar to the ones used by GitHub runners. Notably:
|
if the [virtual environment](https://github.com/actions/virtual-environments) is very similar to the ones used by GitHub runners. Notably:
|
||||||
|
|
||||||
* Make sure to use the same operating system and version.
|
* Make sure to use the same operating system and version.
|
||||||
* Set the environment variable `ImageOS` to the corresponding value on GitHub-hosted runners (e.g. `ubuntu18`/`macos1015`/`win19`). This is necessary to detect the operating system and version.
|
* Set the environment variable `ImageOS` on the runner to the corresponding value on GitHub-hosted runners (e.g. `ubuntu18`/`macos1015`/`win19`). This is necessary to detect the operating system and version.
|
||||||
* Make sure to use the same version of libssl.
|
* Make sure to use the same version of libssl.
|
||||||
* Make sure that the operating system has `libyaml-0` installed
|
* Make sure that the operating system has `libyaml-0` installed
|
||||||
* The default tool cache directory (`/opt/hostedtoolcache` on Linux, `/Users/runner/hostedtoolcache` on macOS,
|
* The default tool cache directory (`/opt/hostedtoolcache` on Linux, `/Users/runner/hostedtoolcache` on macOS,
|
||||||
|
|||||||
@@ -72,12 +72,17 @@ export async function installBundler(bundlerVersionInput, lockFile, platform, ru
|
|||||||
if (engine === 'ruby' && rubyVersion.match(/^2\.[012]/)) {
|
if (engine === 'ruby' && rubyVersion.match(/^2\.[012]/)) {
|
||||||
console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2')
|
console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2')
|
||||||
bundlerVersion = '1'
|
bundlerVersion = '1'
|
||||||
|
} else if (engine === 'ruby' && rubyVersion.match(/^2\.3\.[01]/)) {
|
||||||
|
console.log('Ruby 2.3.0 and 2.3.1 have shipped with an old rubygems that only works with Bundler 1')
|
||||||
|
bundlerVersion = '1'
|
||||||
} else if (engine === 'jruby' && rubyVersion.startsWith('9.1')) { // JRuby 9.1 targets Ruby 2.3, treat it the same
|
} else if (engine === 'jruby' && rubyVersion.startsWith('9.1')) { // JRuby 9.1 targets Ruby 2.3, treat it the same
|
||||||
console.log('JRuby 9.1 has a bug with Bundler 2 (https://github.com/ruby/setup-ruby/issues/108), using Bundler 1 instead on JRuby 9.1')
|
console.log('JRuby 9.1 has a bug with Bundler 2 (https://github.com/ruby/setup-ruby/issues/108), using Bundler 1 instead on JRuby 9.1')
|
||||||
bundlerVersion = '1'
|
bundlerVersion = '1'
|
||||||
}
|
}
|
||||||
|
|
||||||
if (common.isHeadVersion(rubyVersion) && common.isBundler2Default(engine, rubyVersion) && bundlerVersion.startsWith('2')) {
|
if (common.isHeadVersion(rubyVersion) && common.isBundler2Default(engine, rubyVersion) && bundlerVersion.startsWith('2')) {
|
||||||
|
// Avoid installing a newer Bundler version for head versions as it might not work.
|
||||||
|
// For releases, even if they ship with Bundler 2 we install the latest Bundler.
|
||||||
console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`)
|
console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`)
|
||||||
} else if (engine === 'truffleruby' && !common.isHeadVersion(rubyVersion) && bundlerVersion.startsWith('1')) {
|
} else if (engine === 'truffleruby' && !common.isHeadVersion(rubyVersion) && bundlerVersion.startsWith('1')) {
|
||||||
console.log(`Using Bundler 1 shipped with ${engine}`)
|
console.log(`Using Bundler 1 shipped with ${engine}`)
|
||||||
|
|||||||
@@ -59,7 +59,9 @@ export function isBundler2Default(engine, rubyVersion) {
|
|||||||
if (engine === 'ruby') {
|
if (engine === 'ruby') {
|
||||||
return isHeadVersion(rubyVersion) || floatVersion(rubyVersion) >= 2.7
|
return isHeadVersion(rubyVersion) || floatVersion(rubyVersion) >= 2.7
|
||||||
} else if (engine === 'truffleruby') {
|
} else if (engine === 'truffleruby') {
|
||||||
return isHeadVersion(rubyVersion)
|
return isHeadVersion(rubyVersion) || floatVersion(rubyVersion) >= 21.0
|
||||||
|
} else if (engine === 'jruby') {
|
||||||
|
return isHeadVersion(rubyVersion) || floatVersion(rubyVersion) >= 9.3
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-2
@@ -32851,7 +32851,9 @@ function isBundler2Default(engine, rubyVersion) {
|
|||||||
if (engine === 'ruby') {
|
if (engine === 'ruby') {
|
||||||
return isHeadVersion(rubyVersion) || floatVersion(rubyVersion) >= 2.7
|
return isHeadVersion(rubyVersion) || floatVersion(rubyVersion) >= 2.7
|
||||||
} else if (engine === 'truffleruby') {
|
} else if (engine === 'truffleruby') {
|
||||||
return isHeadVersion(rubyVersion)
|
return isHeadVersion(rubyVersion) || floatVersion(rubyVersion) >= 21.0
|
||||||
|
} else if (engine === 'jruby') {
|
||||||
|
return isHeadVersion(rubyVersion) || floatVersion(rubyVersion) >= 9.3
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -44608,12 +44610,17 @@ async function installBundler(bundlerVersionInput, lockFile, platform, rubyPrefi
|
|||||||
if (engine === 'ruby' && rubyVersion.match(/^2\.[012]/)) {
|
if (engine === 'ruby' && rubyVersion.match(/^2\.[012]/)) {
|
||||||
console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2')
|
console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2')
|
||||||
bundlerVersion = '1'
|
bundlerVersion = '1'
|
||||||
|
} else if (engine === 'ruby' && rubyVersion.match(/^2\.3\.[01]/)) {
|
||||||
|
console.log('Ruby 2.3.0 and 2.3.1 have shipped with an old rubygems that only works with Bundler 1')
|
||||||
|
bundlerVersion = '1'
|
||||||
} else if (engine === 'jruby' && rubyVersion.startsWith('9.1')) { // JRuby 9.1 targets Ruby 2.3, treat it the same
|
} else if (engine === 'jruby' && rubyVersion.startsWith('9.1')) { // JRuby 9.1 targets Ruby 2.3, treat it the same
|
||||||
console.log('JRuby 9.1 has a bug with Bundler 2 (https://github.com/ruby/setup-ruby/issues/108), using Bundler 1 instead on JRuby 9.1')
|
console.log('JRuby 9.1 has a bug with Bundler 2 (https://github.com/ruby/setup-ruby/issues/108), using Bundler 1 instead on JRuby 9.1')
|
||||||
bundlerVersion = '1'
|
bundlerVersion = '1'
|
||||||
}
|
}
|
||||||
|
|
||||||
if (common.isHeadVersion(rubyVersion) && common.isBundler2Default(engine, rubyVersion) && bundlerVersion.startsWith('2')) {
|
if (common.isHeadVersion(rubyVersion) && common.isBundler2Default(engine, rubyVersion) && bundlerVersion.startsWith('2')) {
|
||||||
|
// Avoid installing a newer Bundler version for head versions as it might not work.
|
||||||
|
// For releases, even if they ship with Bundler 2 we install the latest Bundler.
|
||||||
console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`)
|
console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`)
|
||||||
} else if (engine === 'truffleruby' && !common.isHeadVersion(rubyVersion) && bundlerVersion.startsWith('1')) {
|
} else if (engine === 'truffleruby' && !common.isHeadVersion(rubyVersion) && bundlerVersion.startsWith('1')) {
|
||||||
console.log(`Using Bundler 1 shipped with ${engine}`)
|
console.log(`Using Bundler 1 shipped with ${engine}`)
|
||||||
@@ -45351,7 +45358,7 @@ function getVersions(platform) {
|
|||||||
],
|
],
|
||||||
"jruby": [
|
"jruby": [
|
||||||
"9.1.17.0",
|
"9.1.17.0",
|
||||||
"9.2.9.0", "9.2.10.0", "9.2.11.0", "9.2.11.1", "9.2.12.0", "9.2.13.0", "9.2.14.0",
|
"9.2.9.0", "9.2.10.0", "9.2.11.0", "9.2.11.1", "9.2.12.0", "9.2.13.0", "9.2.14.0", "9.2.15.0", "9.2.16.0", "9.2.17.0",
|
||||||
"head"
|
"head"
|
||||||
],
|
],
|
||||||
"truffleruby": [
|
"truffleruby": [
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/sh
|
#!/usr/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
yarn install
|
||||||
yarn run package
|
yarn run package
|
||||||
exec git add dist/index.js
|
exec git add dist/index.js
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export function getVersions(platform) {
|
|||||||
],
|
],
|
||||||
"jruby": [
|
"jruby": [
|
||||||
"9.1.17.0",
|
"9.1.17.0",
|
||||||
"9.2.9.0", "9.2.10.0", "9.2.11.0", "9.2.11.1", "9.2.12.0", "9.2.13.0", "9.2.14.0",
|
"9.2.9.0", "9.2.10.0", "9.2.11.0", "9.2.11.1", "9.2.12.0", "9.2.13.0", "9.2.14.0", "9.2.15.0", "9.2.16.0", "9.2.17.0",
|
||||||
"head"
|
"head"
|
||||||
],
|
],
|
||||||
"truffleruby": [
|
"truffleruby": [
|
||||||
|
|||||||
Reference in New Issue
Block a user