Compare commits

...
13 Commits
Author SHA1 Message Date
Benoit Daloze 66836a17bb Add TruffleRuby 19.3.1 2020-01-15 10:54:10 +01:00
Benoit Daloze 933f496844 Add a note about Ruby 2.4 on Windows
* See https://github.com/eregon/ruby-build/pull/1#issuecomment-573237440
2020-01-11 00:03:25 +01:00
Benoit Daloze b3249de963 Fix typo 2020-01-10 23:07:19 +01:00
Benoit Daloze 2a5386fca2 Improve clarity about the key for caching bundle install 2020-01-10 23:06:04 +01:00
Benoit Daloze 51f9fc6d8a Show a full example for caching bundle install
* Which should help avoid conflicts with previous caches
* See https://github.com/eregon/use-ruby-action/issues/7
2020-01-10 23:00:33 +01:00
Benoit Daloze 0b83c28888 Add a note about the workaround for https://github.com/actions/virtual-environments/issues/242 2020-01-09 18:16:05 +01:00
MSP-Greg 98c68de273 Set CLASSPATH to empty for JRuby 2020-01-09 18:15:08 +01:00
Benoit Daloze 4c25e810ed All 33 Ruby versions between 2.3.0 and 2.7.0 are now supported 2020-01-09 00:12:16 +01:00
Benoit Daloze 2127b4bb68 All Ruby versions between 2.4.0 and 2.6.5 are now supported 2020-01-08 22:47:25 +01:00
MSP-Greg 626b752912 Correct Windows MSYS2 paths 2020-01-08 22:41:06 +01:00
Benoit Daloze 819c372fe9 Install Bundler 1 on Windows for Ruby < 2.6 without Bundler 2020-01-08 22:15:01 +01:00
Benoit Daloze 268389d93d Use Bundler 1 for Rubies which don't already ship Bundler (< 2.6) 2020-01-08 21:55:11 +01:00
Benoit Daloze 92bcdc74f7 Link to the actions/cache example for Bundler caching 2020-01-07 22:11:59 +01:00
4 changed files with 40 additions and 7 deletions
+28 -3
View File
@@ -11,9 +11,9 @@ This action currently supports these versions of MRI, JRuby and TruffleRuby:
| Interpreter | Versions |
| ----------- | -------- |
| Ruby | 2.3.8, 2.4.9, 2.5.7, 2.6.5, 2.7.0 |
| Ruby | 2.3.0 - 2.3.8, 2.4.0 - 2.4.9, 2.5.0 - 2.5.7, 2.6.0 - 2.6.5, 2.7.0 |
| JRuby | 9.2.9.0 |
| TruffleRuby | 19.3.0 |
| TruffleRuby | 19.3.0, 19.3.1 |
The recommended way to refer to these versions is:
`2.3`, `2.4`, `2.5`, `2.6`, `2.7`, `jruby`, `truffleruby`.
@@ -24,6 +24,7 @@ for the always up-to-date list of available Ruby versions.
Note that Ruby 2.3 and the OpenSSL version it needs (1.0.2) are both end-of-life,
which means Ruby 2.3 is unmaintained and considered insecure.
On Windows, Ruby 2.4 uses OpenSSL 1.0.2, which is no longer maintained.
### Supported Platforms
@@ -88,7 +89,31 @@ jobs:
Currently, Bundler is guaranteed to be installed for all versions.
If the Ruby ships with Bundler (Ruby >= 2.6), that version is used.
Otherwise (Ruby < 2.6), the latest version of Bundler is installed when that Ruby was built.
Otherwise (Ruby < 2.6), Bundler 1 is installed when that Ruby was built.
### Caching `bundle install`
You can cache the installed gems with these two steps:
```yaml
- uses: actions/cache@v1
with:
path: vendor/bundle
key: bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby }}-
- name: Bundle install
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
```
When using a single job with a Ruby version, replace `${{ matrix.ruby }}` with the Ruby version.
When using `.ruby-version`, replace `${{ matrix.ruby }}` with `${{ hashFiles('.ruby-version') }}`.
This uses the [cache action](https://github.com/actions/cache).
The code above is a more complete version of the [Ruby - Gem example](https://github.com/actions/cache/blob/master/examples.md#ruby---gem).
Make sure to include `use-ruby` in the `key` to avoid conflicting with previous caches.
## Limitations
Generated Vendored
+6 -2
View File
@@ -1399,6 +1399,10 @@ async function run() {
if (platform === 'windows-latest') {
rubyPrefix = await windows.downloadExtractAndSetPATH(ruby)
} else {
if (ruby.startsWith('jruby')) {
// Workaround for https://github.com/actions/virtual-environments/issues/242
core.exportVariable('CLASSPATH', '')
}
rubyPrefix = await downloadAndExtract(platform, ruby)
core.addPath(`${rubyPrefix}/bin`)
}
@@ -6495,7 +6499,7 @@ async function downloadExtractAndSetPATH(ruby) {
core.exportVariable('PATH', newPath)
if (!fs.existsSync(`${rubyPrefix}\\bin\\bundle.cmd`)) {
await exec.exec(`${rubyPrefix}\\bin\\gem install bundler --no-document`)
await exec.exec(`${rubyPrefix}\\bin\\gem install bundler -v "~> 1" --no-document`)
}
return rubyPrefix
@@ -6526,7 +6530,7 @@ function setupPath(msys2, rubyPrefix) {
path = path.filter(e => !e.match(/\bRuby\b/))
// Add MSYS2 in PATH
path.unshift(`${msys2}\\mingw64`, `${msys2}\\usr`)
path.unshift(`${msys2}\\mingw64\\bin`, `${msys2}\\usr\\bin`)
// Add the downloaded Ruby in PATH
path.unshift(`${rubyPrefix}\\bin`)
+4
View File
@@ -18,6 +18,10 @@ async function run() {
if (platform === 'windows-latest') {
rubyPrefix = await windows.downloadExtractAndSetPATH(ruby)
} else {
if (ruby.startsWith('jruby')) {
// Workaround for https://github.com/actions/virtual-environments/issues/242
core.exportVariable('CLASSPATH', '')
}
rubyPrefix = await downloadAndExtract(platform, ruby)
core.addPath(`${rubyPrefix}/bin`)
}
+2 -2
View File
@@ -28,7 +28,7 @@ export async function downloadExtractAndSetPATH(ruby) {
core.exportVariable('PATH', newPath)
if (!fs.existsSync(`${rubyPrefix}\\bin\\bundle.cmd`)) {
await exec.exec(`${rubyPrefix}\\bin\\gem install bundler --no-document`)
await exec.exec(`${rubyPrefix}\\bin\\gem install bundler -v "~> 1" --no-document`)
}
return rubyPrefix
@@ -59,7 +59,7 @@ function setupPath(msys2, rubyPrefix) {
path = path.filter(e => !e.match(/\bRuby\b/))
// Add MSYS2 in PATH
path.unshift(`${msys2}\\mingw64`, `${msys2}\\usr`)
path.unshift(`${msys2}\\mingw64\\bin`, `${msys2}\\usr\\bin`)
// Add the downloaded Ruby in PATH
path.unshift(`${rubyPrefix}\\bin`)