Skip to content

Commit 6d076d2

Browse files
Add testing infrastructure
This adds testing infrastructure to test against multiple versions of Rails, including Rails `main` branch.
1 parent bdbc46a commit 6d076d2

16 files changed

+1088
-47
lines changed

.github/workflows/ci.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
on: [push, pull_request]
3+
jobs:
4+
tests:
5+
strategy:
6+
fail-fast: false
7+
matrix:
8+
ruby-version:
9+
- "3.0"
10+
- "3.1"
11+
- "3.2"
12+
gemfile:
13+
- Gemfile
14+
- gemfiles/rails_7_0_propshaft.gemfile
15+
- gemfiles/rails_7_1_propshaft.gemfile
16+
- gemfiles/rails_main_propshaft.gemfile
17+
- gemfiles/rails_7_0_sprockets.gemfile
18+
- gemfiles/rails_7_1_sprockets.gemfile
19+
- gemfiles/rails_main_sprockets.gemfile
20+
continue-on-error: [ false ]
21+
22+
name: ${{ format('Tests (Ruby {0}, {1})', matrix.ruby-version, matrix.gemfile) }}
23+
runs-on: ubuntu-latest
24+
continue-on-error: ${{ matrix.continue-on-error }}
25+
26+
env:
27+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
28+
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Remove Gemfile lock
33+
run: |
34+
rm -f $BUNDLE_GEMFILE.lock
35+
36+
- name: Install Ruby
37+
uses: ruby/setup-ruby@v1
38+
with:
39+
ruby-version: ${{ matrix.ruby-version }}
40+
bundler-cache: true
41+
42+
# This prevents a "Failed to build gem native extension" error when
43+
# running `bundle install` inside a Rails app that is generated for
44+
# testing. The error occurs only in CI, and only when using Ruby 3.0 and
45+
# Rails >= 7.1.
46+
- name: Install sass-embedded gem
47+
if: ${{ matrix.ruby-version == '3.0' }}
48+
run: gem install sass-embedded
49+
50+
- name: Run tests
51+
run: |
52+
bundle exec rake

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@
1414
.idea/
1515
**/tmp/
1616
/exe/*/tailwindcss
17+
18+
# Ignore Gemfile.lock files for Rails main branch.
19+
/gemfiles/rails_main*.gemfile.lock

Appraisals

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
appraise "rails_7_0_sprockets" do
2+
gem "rails", "~> 7.0.0"
3+
gem "sprockets-rails"
4+
end
5+
6+
appraise "rails_7_0_propshaft" do
7+
gem "rails", "~> 7.0.0"
8+
gem "propshaft"
9+
end
10+
11+
appraise "rails_7_1_sprockets" do
12+
gem "rails", "~> 7.1.0"
13+
gem "sprockets-rails"
14+
end
15+
16+
appraise "rails_7_1_propshaft" do
17+
gem "rails", "~> 7.1.0"
18+
gem "propshaft"
19+
end
20+
21+
appraise "rails_main_sprockets" do
22+
gem "rails", github: "rails/rails", branch: "main"
23+
gem "sprockets-rails"
24+
end
25+
26+
appraise "rails_main_propshaft" do
27+
gem "rails", github: "rails/rails", branch: "main"
28+
gem "propshaft"
29+
end

Gemfile

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
source 'https://rubygems.org'
22
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3+
34
gemspec
45

6+
gem "appraisal"
7+
gem "rails", "~> 6.1.0"
58
gem "sqlite3"
69
gem "debug", ">= 1.0.0"
7-
8-
group :test do
9-
gem "actionmailer", ">= 6.0.0"
10-
end

Gemfile.lock

+121-43
Original file line numberDiff line numberDiff line change
@@ -8,96 +8,174 @@ PATH
88
GEM
99
remote: https://rubygems.org/
1010
specs:
11-
actionmailer (6.1.4.1)
12-
actionpack (= 6.1.4.1)
13-
actionview (= 6.1.4.1)
14-
activejob (= 6.1.4.1)
15-
activesupport (= 6.1.4.1)
11+
actioncable (6.1.7.6)
12+
actionpack (= 6.1.7.6)
13+
activesupport (= 6.1.7.6)
14+
nio4r (~> 2.0)
15+
websocket-driver (>= 0.6.1)
16+
actionmailbox (6.1.7.6)
17+
actionpack (= 6.1.7.6)
18+
activejob (= 6.1.7.6)
19+
activerecord (= 6.1.7.6)
20+
activestorage (= 6.1.7.6)
21+
activesupport (= 6.1.7.6)
22+
mail (>= 2.7.1)
23+
actionmailer (6.1.7.6)
24+
actionpack (= 6.1.7.6)
25+
actionview (= 6.1.7.6)
26+
activejob (= 6.1.7.6)
27+
activesupport (= 6.1.7.6)
1628
mail (~> 2.5, >= 2.5.4)
1729
rails-dom-testing (~> 2.0)
18-
actionpack (6.1.4.1)
19-
actionview (= 6.1.4.1)
20-
activesupport (= 6.1.4.1)
30+
actionpack (6.1.7.6)
31+
actionview (= 6.1.7.6)
32+
activesupport (= 6.1.7.6)
2133
rack (~> 2.0, >= 2.0.9)
2234
rack-test (>= 0.6.3)
2335
rails-dom-testing (~> 2.0)
2436
rails-html-sanitizer (~> 1.0, >= 1.2.0)
25-
actionview (6.1.4.1)
26-
activesupport (= 6.1.4.1)
37+
actiontext (6.1.7.6)
38+
actionpack (= 6.1.7.6)
39+
activerecord (= 6.1.7.6)
40+
activestorage (= 6.1.7.6)
41+
activesupport (= 6.1.7.6)
42+
nokogiri (>= 1.8.5)
43+
actionview (6.1.7.6)
44+
activesupport (= 6.1.7.6)
2745
builder (~> 3.1)
2846
erubi (~> 1.4)
2947
rails-dom-testing (~> 2.0)
3048
rails-html-sanitizer (~> 1.1, >= 1.2.0)
31-
activejob (6.1.4.1)
32-
activesupport (= 6.1.4.1)
49+
activejob (6.1.7.6)
50+
activesupport (= 6.1.7.6)
3351
globalid (>= 0.3.6)
34-
activesupport (6.1.4.1)
52+
activemodel (6.1.7.6)
53+
activesupport (= 6.1.7.6)
54+
activerecord (6.1.7.6)
55+
activemodel (= 6.1.7.6)
56+
activesupport (= 6.1.7.6)
57+
activestorage (6.1.7.6)
58+
actionpack (= 6.1.7.6)
59+
activejob (= 6.1.7.6)
60+
activerecord (= 6.1.7.6)
61+
activesupport (= 6.1.7.6)
62+
marcel (~> 1.0)
63+
mini_mime (>= 1.1.0)
64+
activesupport (6.1.7.6)
3565
concurrent-ruby (~> 1.0, >= 1.0.2)
3666
i18n (>= 1.6, < 2)
3767
minitest (>= 5.1)
3868
tzinfo (~> 2.0)
3969
zeitwerk (~> 2.3)
70+
appraisal (2.5.0)
71+
bundler
72+
rake
73+
thor (>= 0.14.0)
4074
builder (3.2.4)
41-
concurrent-ruby (1.1.9)
75+
concurrent-ruby (1.2.2)
4276
crass (1.0.6)
77+
date (3.3.4)
4378
debug (1.1.0)
4479
irb
4580
reline (>= 0.2.7)
46-
erubi (1.10.0)
47-
globalid (1.0.0)
48-
activesupport (>= 5.0)
81+
erubi (1.12.0)
82+
globalid (1.2.1)
83+
activesupport (>= 6.1)
4984
google-protobuf (3.23.3)
50-
i18n (1.8.11)
85+
i18n (1.14.1)
5186
concurrent-ruby (~> 1.0)
5287
io-console (0.5.9)
5388
irb (1.3.7)
5489
reline (>= 0.2.7)
55-
loofah (2.12.0)
90+
loofah (2.22.0)
5691
crass (~> 1.0.2)
57-
nokogiri (>= 1.5.9)
58-
mail (2.7.1)
92+
nokogiri (>= 1.12.0)
93+
mail (2.8.1)
5994
mini_mime (>= 0.1.1)
95+
net-imap
96+
net-pop
97+
net-smtp
98+
marcel (1.0.2)
6099
method_source (1.0.0)
61-
mini_mime (1.1.2)
62-
mini_portile2 (2.6.1)
63-
minitest (5.14.4)
64-
nokogiri (1.12.5)
65-
mini_portile2 (~> 2.6.1)
100+
mini_mime (1.1.5)
101+
mini_portile2 (2.8.5)
102+
minitest (5.20.0)
103+
net-imap (0.4.7)
104+
date
105+
net-protocol
106+
net-pop (0.1.2)
107+
net-protocol
108+
net-protocol (0.2.2)
109+
timeout
110+
net-smtp (0.4.0)
111+
net-protocol
112+
nio4r (2.7.0)
113+
nokogiri (1.15.5)
114+
mini_portile2 (~> 2.8.2)
66115
racc (~> 1.4)
67-
racc (1.6.0)
68-
rack (2.2.3)
69-
rack-test (1.1.0)
70-
rack (>= 1.0, < 3)
71-
rails-dom-testing (2.0.3)
72-
activesupport (>= 4.2.0)
116+
racc (1.7.3)
117+
rack (2.2.8)
118+
rack-test (2.1.0)
119+
rack (>= 1.3)
120+
rails (6.1.7.6)
121+
actioncable (= 6.1.7.6)
122+
actionmailbox (= 6.1.7.6)
123+
actionmailer (= 6.1.7.6)
124+
actionpack (= 6.1.7.6)
125+
actiontext (= 6.1.7.6)
126+
actionview (= 6.1.7.6)
127+
activejob (= 6.1.7.6)
128+
activemodel (= 6.1.7.6)
129+
activerecord (= 6.1.7.6)
130+
activestorage (= 6.1.7.6)
131+
activesupport (= 6.1.7.6)
132+
bundler (>= 1.15.0)
133+
railties (= 6.1.7.6)
134+
sprockets-rails (>= 2.0.0)
135+
rails-dom-testing (2.2.0)
136+
activesupport (>= 5.0.0)
137+
minitest
73138
nokogiri (>= 1.6)
74-
rails-html-sanitizer (1.4.2)
75-
loofah (~> 2.3)
76-
railties (6.1.4.1)
77-
actionpack (= 6.1.4.1)
78-
activesupport (= 6.1.4.1)
139+
rails-html-sanitizer (1.6.0)
140+
loofah (~> 2.21)
141+
nokogiri (~> 1.14)
142+
railties (6.1.7.6)
143+
actionpack (= 6.1.7.6)
144+
activesupport (= 6.1.7.6)
79145
method_source
80-
rake (>= 0.13)
146+
rake (>= 12.2)
81147
thor (~> 1.0)
82-
rake (13.0.6)
148+
rake (13.1.0)
83149
reline (0.2.7)
84150
io-console (~> 0.5)
85151
sass-embedded (1.63.4)
86152
google-protobuf (~> 3.23)
87153
rake (>= 13.0.0)
154+
sprockets (4.2.1)
155+
concurrent-ruby (~> 1.0)
156+
rack (>= 2.2.4, < 4)
157+
sprockets-rails (3.4.2)
158+
actionpack (>= 5.2)
159+
activesupport (>= 5.2)
160+
sprockets (>= 3.0.0)
88161
sqlite3 (1.4.2)
89-
thor (1.2.2)
90-
tzinfo (2.0.4)
162+
thor (1.3.0)
163+
timeout (0.4.1)
164+
tzinfo (2.0.6)
91165
concurrent-ruby (~> 1.0)
92-
zeitwerk (2.5.1)
166+
websocket-driver (0.7.6)
167+
websocket-extensions (>= 0.1.0)
168+
websocket-extensions (0.1.5)
169+
zeitwerk (2.6.12)
93170

94171
PLATFORMS
95172
ruby
96173

97174
DEPENDENCIES
98-
actionmailer (>= 6.0.0)
175+
appraisal
99176
dartsass-rails!
100177
debug (>= 1.0.0)
178+
rails (~> 6.1.0)
101179
sqlite3
102180

103181
BUNDLED WITH

gemfiles/rails_7_0_propshaft.gemfile

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "appraisal"
6+
gem "rails", "~> 7.0.0"
7+
gem "sqlite3"
8+
gem "debug", ">= 1.0.0"
9+
gem "propshaft"
10+
11+
gemspec path: "../"

0 commit comments

Comments
 (0)