You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The easiest way to specify a Ruby version is by using the `ruby/setup-ruby` action provided by the Ruby organization on GitHub. The action adds any supported Ruby version to `PATH` for each job run in a workflow. For more information see, the [`ruby/setup-ruby`](https://github.com/ruby/setup-ruby).
68
+
The easiest way to specify a Ruby version is by using the `ruby/setup-ruby` action provided by the Ruby organization on GitHub. The action adds any supported Ruby version to `PATH` for each job run in a workflow. For more information and available Ruby versions, see [`ruby/setup-ruby`](https://github.com/ruby/setup-ruby).
69
69
70
70
Using Ruby's `ruby/setup-ruby` action is the recommended way of using Ruby with GitHub Actions because it ensures consistent behavior across different runners and different versions of Ruby.
71
71
@@ -75,9 +75,9 @@ The `setup-ruby` action takes a Ruby version as an input and configures that ver
ruby-version: 2.6 # Not needed with a .ruby-version file
80
+
ruby-version: '3.1' # Not needed with a .ruby-version file
81
81
- run: bundle install
82
82
- run: bundle exec rake
83
83
```
@@ -87,13 +87,13 @@ Alternatively, you can check a `.ruby-version` file into the root of your repos
87
87
88
88
## Testing with multiple versions of Ruby
89
89
90
-
You can add a matrix strategy to run your workflow with more than one version of Ruby. For example, you can test your code against the latest patch releases of versions 2.7, 2.6, and 2.5. The 'x' is a wildcard character that matches the latest patch release available for a version.
90
+
You can add a matrix strategy to run your workflow with more than one version of Ruby. For example, you can test your code against the latest patch releases of versions 3.1, 3.0, and 2.7.
91
91
92
92
{% raw %}
93
93
```yaml
94
94
strategy:
95
95
matrix:
96
-
ruby-version: [2.7.x, 2.6.x, 2.5.x]
96
+
ruby-version: ['3.1', '3.0', '2.7']
97
97
```
98
98
{% endraw %}
99
99
@@ -119,12 +119,12 @@ jobs:
119
119
120
120
strategy:
121
121
matrix:
122
-
ruby-version: [2.7.x, 2.6.x, 2.5.x]
122
+
ruby-version: ['3.1', '3.0', '2.7']
123
123
124
124
steps:
125
125
- uses: actions/checkout@v2
126
126
- name: {% raw %}Set up Ruby ${{ matrix.ruby-version }}{% endraw %}
0 commit comments