Skip to content

Commit 54b4549

Browse files
authored
Test against all supported versions of Ruby (#31)
Flesh out the matrix of versions of Ruby that we test the gem against, adding all three versions that are currently considered to be in maintenance (3.1, 3.2, 3.3) [1]. The setup-ruby step requires a version be specified, so we have a slightly awkward situation here were non-spec jobs use a default `RUBY_VERSION` from env, while the spec job gets a matrix containing more than one version. I've added comments to `RUBY_VERSION` and the matrix to hopefully suggest to anyone making a modification that changing one of them probably means you want to update the other too. [1] https://www.ruby-lang.org/en/downloads/branches/
1 parent 5097d21 commit 54b4549

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ env:
88
# to GITHUB_PATH/PATH.
99
BIN_PATH: /home/runner/bin
1010

11+
# The version of Ruby that non-spec tasks like the build check or lint run
12+
# against. The setup-ruby step must have a version specified, which is why
13+
# this is necessary.
14+
#
15+
# If updating this value, you probably also want to add a new version to the
16+
# spec version matrix below.
1117
RUBY_VERSION: "3.3"
1218

1319
# A suitable URL for a test database.
@@ -99,6 +105,14 @@ jobs:
99105
spec:
100106
runs-on: ubuntu-latest
101107
timeout-minutes: 3
108+
strategy:
109+
matrix:
110+
# If adding a value, you probably also want to update the default
111+
# RUBY_VERSION for non-spec jobs above.
112+
ruby_version:
113+
- "3.1"
114+
- "3.2"
115+
- "3.3"
102116

103117
services:
104118
postgres:
@@ -120,7 +134,7 @@ jobs:
120134
- name: Install Ruby + `bundle install`
121135
uses: ruby/setup-ruby@v1
122136
with:
123-
ruby-version: ${{ env.RUBY_VERSION }}
137+
ruby-version: ${{ matrix.ruby_version }}
124138
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
125139

126140
# Needed for River's CLI. There is a version of Go on Actions' base image,

0 commit comments

Comments
 (0)