mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 06:34:19 +02:00
Add an example for testing against all stable versions
* Test it in CI too.
This commit is contained in:
@@ -6,7 +6,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ 'ubuntu-16.04', 'ubuntu-18.04', 'macos-latest' ]
|
||||
ruby: [ 'ruby-2.6.5', '2.7.0', 'truffleruby', 'jruby-9.2.9.0' ]
|
||||
ruby: [ '2.4.9', '2.5.7', '2.6.5', '2.7.0', 'truffleruby', 'jruby' ]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
@@ -14,7 +14,7 @@ The prebuilt rubies are generated by https://github.com/eregon/ruby-install-buil
|
||||
|
||||
## Usage
|
||||
|
||||
Single job:
|
||||
### Single Job
|
||||
|
||||
```yaml
|
||||
name: My workflow
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
- run: ruby -v
|
||||
```
|
||||
|
||||
Matrix:
|
||||
### Matrix
|
||||
|
||||
```yaml
|
||||
name: My workflow
|
||||
@@ -52,9 +52,33 @@ jobs:
|
||||
```
|
||||
|
||||
If a specific version is not given, it uses the latest stable release of that implementation.
|
||||
|
||||
For instance `truffleruby` is currently the same as `truffleruby-19.3.0`.
|
||||
|
||||
If it's just a version number (e.g., `2.6.5`), then MRI is assumed (same as `ruby-2.6.5`).
|
||||
|
||||
### All Stable Versions
|
||||
|
||||
With that, we can test on all stable releases of MRI, JRuby and TruffleRuby with:
|
||||
|
||||
```yaml
|
||||
name: My workflow
|
||||
on: [push]
|
||||
jobs:
|
||||
test:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ 'ubuntu-latest', 'macos-latest' ]
|
||||
ruby: [ '2.4.9', '2.5.7', '2.6.5', '2.7.0', 'truffleruby', 'jruby' ]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: eregon/use-ruby-action@master
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby }}
|
||||
- run: ruby -v
|
||||
```
|
||||
|
||||
## Efficiency
|
||||
|
||||
It takes about 5 seconds to setup the given Ruby.
|
||||
|
||||
Reference in New Issue
Block a user