Add an example for testing against all stable versions

* Test it in CI too.
This commit is contained in:
Benoit Daloze
2020-01-02 22:58:57 +01:00
parent b8d447ba75
commit d4d232f50e
2 changed files with 28 additions and 4 deletions
+1 -1
View File
@@ -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
+27 -3
View File
@@ -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.