Skip to content

Commit c3c18bc

Browse files
authored
Merge pull request #144 from willnet/update-ci-matrix
Improve the CI matrix to run tests on multiple Rails versions
2 parents b087d6e + 6bd2e8a commit c3c18bc

File tree

7 files changed

+87
-9
lines changed

7 files changed

+87
-9
lines changed

.github/workflows/main.yml

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,34 @@ on:
88
branches: [ master ]
99

1010
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Ruby 3.4
17+
uses: ruby/setup-ruby@v1
18+
with:
19+
ruby-version: "3.4"
20+
bundler-cache: true
21+
22+
- name: Lint with Rubocop
23+
run: bundle exec rubocop
24+
25+
build:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- name: Set up Ruby 3.4
31+
uses: ruby/setup-ruby@v1
32+
with:
33+
ruby-version: "3.4"
34+
bundler-cache: true
35+
36+
- name: Build gem
37+
run: bundle exec rake build
38+
1139
test:
1240
runs-on: ubuntu-latest
1341
strategy:
@@ -16,7 +44,23 @@ jobs:
1644
- "3.1"
1745
- "3.2"
1846
- "3.3"
47+
- "3.4"
1948
- truffleruby-head
49+
rails-version:
50+
- "6_1"
51+
- "7_0"
52+
- "7_1"
53+
- "7_2"
54+
- "8_0"
55+
exclude:
56+
- ruby-version: "3.4"
57+
rails-version: "6_1"
58+
- ruby-version: "3.4"
59+
rails-version: "7_0"
60+
- ruby-version: "3.1"
61+
rails-version: "8_0"
62+
env:
63+
BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails-version }}.gemfile
2064

2165
steps:
2266
- uses: actions/checkout@v4
@@ -27,14 +71,5 @@ jobs:
2771
ruby-version: ${{ matrix.ruby-version }}
2872
bundler-cache: true
2973

30-
- name: Install dependencies
31-
run: bundle install
32-
33-
- name: Lint with Rubocop
34-
run: bin/rubocop
35-
3674
- name: Run tests
3775
run: bin/rspec
38-
39-
- name: Build gem
40-
run: bin/rake build

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ test/tmp
1717
test/version_tmp
1818
tmp
1919
Gemfile.lock
20+
gemfiles/*.lock
2021

gemfiles/rails_6_1.gemfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# frozen_string_literal: true
2+
3+
source 'http://rubygems.org'
4+
5+
gemspec path: '../'
6+
7+
gem 'concurrent-ruby', '< 1.3.5'
8+
gem 'rails', '~> 6.1.0'
9+
gem 'rspec-rails', '~> 5.1.0'

gemfiles/rails_7_0.gemfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# frozen_string_literal: true
2+
3+
source 'http://rubygems.org'
4+
5+
gemspec path: '../'
6+
7+
gem 'concurrent-ruby', '< 1.3.5'
8+
gem 'rails', '~> 7.0.0'
9+
gem 'rspec-rails', '~> 6.0.0'

gemfiles/rails_7_1.gemfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# frozen_string_literal: true
2+
3+
source 'http://rubygems.org'
4+
5+
gemspec path: '../'
6+
7+
gem 'rails', '~> 7.1.0'
8+
gem 'rspec-rails', '~> 6.1.0'

gemfiles/rails_7_2.gemfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# frozen_string_literal: true
2+
3+
source 'http://rubygems.org'
4+
5+
gemspec path: '../'
6+
7+
gem 'rails', '~> 7.2.0'
8+
gem 'rspec-rails', '~> 6.1.0'

gemfiles/rails_8_0.gemfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# frozen_string_literal: true
2+
3+
source 'http://rubygems.org'
4+
5+
gemspec path: '../'
6+
7+
gem 'rails', '~> 8.0.0'
8+
gem 'rspec-rails', '~> 7.1.0'

0 commit comments

Comments
 (0)