Skip to content

Commit ffd0210

Browse files
committed
Run Ruby tests on all supported Ruby versions
1 parent e27eba5 commit ffd0210

File tree

2 files changed

+42
-30
lines changed

2 files changed

+42
-30
lines changed

.github/workflows/ruby.yml

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,51 @@
1+
---
12
name: Ruby
23

3-
on: [push, pull_request]
4+
on:
5+
pull_request: {}
6+
push:
7+
branches: main
48

59
jobs:
6-
build:
7-
8-
runs-on: ubuntu-latest
9-
10+
rubocop_and_matrix:
11+
runs-on: ubuntu-24.04
12+
outputs:
13+
ruby: ${{ steps.ruby.outputs.versions }}
1014
steps:
1115
- uses: actions/checkout@v4
12-
- name: Set up Ruby 2.7
16+
- name: Set up Ruby
1317
uses: ruby/setup-ruby@v1
1418
with:
15-
ruby-version: '2.7'
16-
bundler: '2.4.22'
19+
ruby-version: '3.4'
1720
bundler-cache: true
18-
- name: Build and test with Rake
19-
run: bundle exec rake
21+
- id: ruby
22+
uses: voxpupuli/ruby-version@v1
23+
24+
test:
25+
runs-on: ubuntu-24.04
26+
needs: rubocop_and_matrix
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }}
31+
name: "Ruby ${{ matrix.ruby }}"
32+
steps:
33+
- uses: actions/checkout@v4
34+
- name: Install Ruby ${{ matrix.ruby }}
35+
uses: ruby/setup-ruby@v1
36+
with:
37+
ruby-version: ${{ matrix.ruby }}
38+
bundler-cache: true
39+
- name: Run tests
40+
run: bundle exec rake
41+
- name: Build gem
42+
run: gem build --verbose *.gemspec
43+
44+
tests:
45+
needs:
46+
- rubocop_and_matrix
47+
- test
48+
runs-on: ubuntu-latest
49+
name: Test suite
50+
steps:
51+
- run: echo Test suite completed

.github/workflows/ruby3.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)