Skip to content

Commit 02ca069

Browse files
committed
CI: Generate ruby matrix dynamically
1 parent a775b25 commit 02ca069

1 file changed

Lines changed: 15 additions & 18 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,33 @@ permissions:
1212
contents: read
1313

1414
jobs:
15-
rubocop_checks:
15+
rubocop_and_matrix:
1616
runs-on: ubuntu-24.04
17-
name: RuboCop
17+
outputs:
18+
ruby: ${{ steps.ruby.outputs.versions }}
1819
steps:
19-
- name: Checkout current PR
20-
uses: actions/checkout@v6
21-
22-
- name: Rubocop checks
20+
- uses: actions/checkout@v6
21+
- name: Install Ruby ${{ matrix.ruby }}
2322
uses: ruby/setup-ruby@v1
2423
with:
25-
ruby-version: '2.7'
24+
ruby-version: "3.4"
2625
bundler-cache: true
27-
- run: bundle exec rake rubocop
26+
- name: Run Rubocop
27+
run: bundle exec rake rubocop
2828
- run: gem build --strict --verbose *.gemspec
29+
- id: ruby
30+
uses: voxpupuli/ruby-version@v2
2931

3032
linux_unit_tests:
3133
needs:
32-
- rubocop_checks
34+
- rubocop_and_matrix
3335
name: Unit tests on Linux with Ruby ${{ matrix.ruby }}
3436
strategy:
3537
fail-fast: false
3638
matrix:
37-
ruby:
38-
- '2.7'
39-
- '3.0'
40-
- '3.2'
41-
- '3.3'
42-
- '3.4'
43-
- '4.0'
44-
- 'jruby-9.4.8.0'
39+
ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }}
40+
include:
41+
- ruby: 'jruby-9.4.8.0'
4542
runs-on: ubuntu-24.04
4643
steps:
4744
- name: Checkout current PR
@@ -161,7 +158,7 @@ jobs:
161158
tests:
162159
if: always()
163160
needs:
164-
- rubocop_checks
161+
- rubocop_and_matrix
165162
- linux_unit_tests
166163
- windows_unit_tests
167164
- acceptance_tests

0 commit comments

Comments
 (0)