Skip to content

Commit d689159

Browse files
authored
Merge pull request #15240 from dentarg/ruby-guide-patch
Improve Ruby guide
2 parents 758fc7f + 4ae3224 commit d689159

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

content/actions/automating-builds-and-tests/building-and-testing-ruby.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ jobs:
5454
steps:
5555
- uses: actions/checkout@v2
5656
- name: Set up Ruby
57-
uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
57+
uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
5858
with:
59-
ruby-version: 2.6
59+
ruby-version: '3.1'
6060
- name: Install dependencies
6161
run: bundle install
6262
- name: Run tests
@@ -65,7 +65,7 @@ jobs:
6565
6666
## Specifying the Ruby version
6767
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 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).
6969

7070
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.
7171

@@ -75,9 +75,9 @@ The `setup-ruby` action takes a Ruby version as an input and configures that ver
7575
```yaml
7676
steps:
7777
- uses: actions/checkout@v2
78-
- uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
78+
- uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
7979
with:
80-
ruby-version: 2.6 # Not needed with a .ruby-version file
80+
ruby-version: '3.1' # Not needed with a .ruby-version file
8181
- run: bundle install
8282
- run: bundle exec rake
8383
```
@@ -87,13 +87,13 @@ Alternatively, you can check a `.ruby-version` file into the root of your repos
8787

8888
## Testing with multiple versions of Ruby
8989

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.
9191

9292
{% raw %}
9393
```yaml
9494
strategy:
9595
matrix:
96-
ruby-version: [2.7.x, 2.6.x, 2.5.x]
96+
ruby-version: ['3.1', '3.0', '2.7']
9797
```
9898
{% endraw %}
9999

@@ -119,12 +119,12 @@ jobs:
119119
120120
strategy:
121121
matrix:
122-
ruby-version: [2.7.x, 2.6.x, 2.5.x]
122+
ruby-version: ['3.1', '3.0', '2.7']
123123
124124
steps:
125125
- uses: actions/checkout@v2
126126
- name: {% raw %}Set up Ruby ${{ matrix.ruby-version }}{% endraw %}
127-
uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
127+
uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
128128
with:
129129
ruby-version: {% raw %}${{ matrix.ruby-version }}{% endraw %}
130130
- name: Install dependencies
@@ -141,9 +141,9 @@ The `setup-ruby` action will automatically install bundler for you. The version
141141
```yaml
142142
steps:
143143
- uses: actions/checkout@v2
144-
- uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
144+
- uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
145145
with:
146-
ruby-version: 2.6
146+
ruby-version: '3.1'
147147
- run: bundle install
148148
```
149149
{% endraw %}
@@ -157,7 +157,7 @@ To enable caching, set the following.
157157
{% raw %}
158158
```yaml
159159
steps:
160-
- uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
160+
- uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
161161
with:
162162
bundler-cache: true
163163
```

0 commit comments

Comments
 (0)