Skip to content

Commit d4d232f

Browse files
committed
Add an example for testing against all stable versions
* Test it in CI too.
1 parent b8d447b commit d4d232f

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
fail-fast: false
77
matrix:
88
os: [ 'ubuntu-16.04', 'ubuntu-18.04', 'macos-latest' ]
9-
ruby: [ 'ruby-2.6.5', '2.7.0', 'truffleruby', 'jruby-9.2.9.0' ]
9+
ruby: [ '2.4.9', '2.5.7', '2.6.5', '2.7.0', 'truffleruby', 'jruby' ]
1010
runs-on: ${{ matrix.os }}
1111
steps:
1212
- uses: actions/checkout@v2

README.md

+27-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The prebuilt rubies are generated by https://github.com/eregon/ruby-install-buil
1414

1515
## Usage
1616

17-
Single job:
17+
### Single Job
1818

1919
```yaml
2020
name: My workflow
@@ -30,7 +30,7 @@ jobs:
3030
- run: ruby -v
3131
```
3232
33-
Matrix:
33+
### Matrix
3434
3535
```yaml
3636
name: My workflow
@@ -52,9 +52,33 @@ jobs:
5252
```
5353
5454
If a specific version is not given, it uses the latest stable release of that implementation.
55-
5655
For instance `truffleruby` is currently the same as `truffleruby-19.3.0`.
5756

57+
If it's just a version number (e.g., `2.6.5`), then MRI is assumed (same as `ruby-2.6.5`).
58+
59+
### All Stable Versions
60+
61+
With that, we can test on all stable releases of MRI, JRuby and TruffleRuby with:
62+
63+
```yaml
64+
name: My workflow
65+
on: [push]
66+
jobs:
67+
test:
68+
strategy:
69+
fail-fast: false
70+
matrix:
71+
os: [ 'ubuntu-latest', 'macos-latest' ]
72+
ruby: [ '2.4.9', '2.5.7', '2.6.5', '2.7.0', 'truffleruby', 'jruby' ]
73+
runs-on: ${{ matrix.os }}
74+
steps:
75+
- uses: actions/checkout@v2
76+
- uses: eregon/use-ruby-action@master
77+
with:
78+
ruby-version: ${{ matrix.ruby }}
79+
- run: ruby -v
80+
```
81+
5882
## Efficiency
5983

6084
It takes about 5 seconds to setup the given Ruby.

0 commit comments

Comments
 (0)