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
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ 'ubuntu-16.04', 'ubuntu-18.04', 'macos-latest' ]
|
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 }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ The prebuilt rubies are generated by https://github.com/eregon/ruby-install-buil
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Single job:
|
### Single Job
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
name: My workflow
|
name: My workflow
|
||||||
@@ -30,7 +30,7 @@ jobs:
|
|||||||
- run: ruby -v
|
- run: ruby -v
|
||||||
```
|
```
|
||||||
|
|
||||||
Matrix:
|
### Matrix
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
name: My workflow
|
name: My workflow
|
||||||
@@ -52,9 +52,33 @@ jobs:
|
|||||||
```
|
```
|
||||||
|
|
||||||
If a specific version is not given, it uses the latest stable release of that implementation.
|
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`.
|
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
|
## Efficiency
|
||||||
|
|
||||||
It takes about 5 seconds to setup the given Ruby.
|
It takes about 5 seconds to setup the given Ruby.
|
||||||
|
|||||||
Reference in New Issue
Block a user