Skip to content

Commit b01ebbe

Browse files
committed
Merge pull request #2404 from rspec/move-to-github-actions
Move MRI build to Github Actions
1 parent 9cf2b1f commit b01ebbe

File tree

5 files changed

+129
-68
lines changed

5 files changed

+129
-68
lines changed

.github/workflows/ci.yml

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: RSpec CI
2+
on:
3+
push:
4+
branches:
5+
- 'main'
6+
- '*-maintenance'
7+
- '*-dev'
8+
pull_request:
9+
branches:
10+
- '*'
11+
jobs:
12+
test:
13+
name: 'Ruby: ${{ matrix.ruby }}, Rails: ${{ matrix.env.RAILS_VERSION }}'
14+
runs-on: ubuntu-20.04
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
# Rails 6.1 builds >= 2.5
20+
- ruby: ruby-3.0.0-preview1
21+
allow_failure: true
22+
env:
23+
RAILS_VERSION: 'master'
24+
- ruby: 2.7.1
25+
env:
26+
RAILS_VERSION: 'master'
27+
- ruby: 2.6.6
28+
env:
29+
RAILS_VERSION: 'master'
30+
- ruby: 2.5.8
31+
env:
32+
RAILS_VERSION: 'master'
33+
34+
# Rails 6.0 builds >= 2.5.0
35+
- ruby: 3.0.0-preview1
36+
env:
37+
RAILS_VERSION: '~> 6.0.0'
38+
- ruby: 2.7
39+
env:
40+
RAILS_VERSION: '~> 6.0.0'
41+
- ruby: 2.6
42+
env:
43+
RAILS_VERSION: '~> 6.0.0'
44+
- ruby: 2.5
45+
env:
46+
RAILS_VERSION: '~> 6.0.0'
47+
# Rails 5.2 builds >= 2.2.2
48+
- ruby: 2.6.6
49+
env:
50+
RAILS_VERSION: '~> 5.2.0'
51+
- ruby: 2.5.8
52+
env:
53+
RAILS_VERSION: '~> 5.2.0'
54+
- ruby: 2.4.10
55+
env:
56+
RAILS_VERSION: '~> 5.2.0'
57+
- ruby: 2.3.8
58+
env:
59+
RAILS_VERSION: '~> 5.2.0'
60+
- ruby: 2.2.10
61+
allow_failure: true
62+
env:
63+
RAILS_VERSION: '~> 5.2.0'
64+
- ruby: 2.2.10
65+
env:
66+
RAILS_VERSION: '5-2-stable'
67+
# Rails 5.1 Builds >= 2.2.2
68+
- ruby: 2.6.6
69+
env:
70+
RAILS_VERSION: '~> 5.1.0'
71+
- ruby: 2.5.8
72+
env:
73+
RAILS_VERSION: '~> 5.1.0'
74+
- ruby: 2.4.10
75+
env:
76+
RAILS_VERSION: '~> 5.1.0'
77+
- ruby: 2.3.8
78+
env:
79+
RAILS_VERSION: '~> 5.1.0'
80+
- ruby: 2.2.10
81+
env:
82+
RAILS_VERSION: '~> 5.1.0'
83+
# Rails 5.0 Builds >= 2.2.2
84+
- ruby: 2.6.6
85+
env:
86+
RAILS_VERSION: '~> 5.0.0'
87+
- ruby: 2.5.8
88+
env:
89+
RAILS_VERSION: '~> 5.0.0'
90+
- ruby: 2.4.10
91+
env:
92+
RAILS_VERSION: '~> 5.0.0'
93+
- ruby: 2.3.8
94+
env:
95+
RAILS_VERSION: '~> 5.0.0'
96+
- ruby: 2.2.10
97+
env:
98+
RAILS_VERSION: '~> 5.0.0'
99+
env: ${{ matrix.env }}
100+
steps:
101+
- uses: actions/checkout@v2
102+
- uses: ruby/setup-ruby@v1
103+
with:
104+
ruby-version: ${{ matrix.ruby }}
105+
- run: script/clone_all_rspec_repos
106+
- run: bundle install --binstubs
107+
- run: script/run_build
108+
continue-on-error: ${{ matrix.allow_failure || false }}

.travis.yml

+7-57
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,7 @@ script: "script/run_build 2>&1"
3939
matrix:
4040
include:
4141
# Rails 6.1 builds >= 2.5
42-
- rvm: ruby-3.0.0-preview1
43-
env: RAILS_VERSION='master'
44-
allow_failure: true
45-
- rvm: 2.7.1
46-
env: RAILS_VERSION='master'
47-
- rvm: 2.6.6
48-
env: RAILS_VERSION='master'
49-
- rvm: 2.5.8
50-
env: RAILS_VERSION='master'
51-
jdk: oraclejdk11
42+
- jdk: oraclejdk11
5243
env:
5344
- RAILS_VERSION='master'
5445
- JRUBY_OPT=--dev
@@ -61,59 +52,18 @@ matrix:
6152
- RAILS_VERSION='~> 6.0.0'
6253
- JRUBY_OPT=--dev
6354
- JAVA_OPTS="--add-opens java.base/sun.nio.ch=org.jruby.dist --add-opens java.base/java.io=org.jruby.dist --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.security.cert=ALL-UNNAMED --add-opens=java.base/java.util.zip=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util.regex=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/javax.crypto=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED"
64-
- rvm: ruby-3.0.0-preview1
65-
env: RAILS_VERSION='~> 6.0.0'
66-
allow_failure: true
67-
- rvm: 2.7.1
68-
env: RAILS_VERSION='~> 6.0.0'
69-
- rvm: 2.6.6
70-
env: RAILS_VERSION='~> 6.0.0'
71-
- rvm: 2.5.8
72-
env: RAILS_VERSION='~> 6.0.0'
7355

74-
# Rails 5.2 builds >= 2.2.2
7556
- rvm: jruby-head
7657
jdk: oraclejdk11
7758
env:
7859
- RAILS_VERSION='~> 5.2.0'
7960
- JRUBY_OPT=--dev
8061
- JAVA_OPTS="--add-opens java.base/sun.nio.ch=org.jruby.dist --add-opens java.base/java.io=org.jruby.dist --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.security.cert=ALL-UNNAMED --add-opens=java.base/java.util.zip=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util.regex=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/javax.crypto=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED"
81-
- rvm: 2.6.6
82-
env: RAILS_VERSION='~> 5.2.0'
83-
- rvm: 2.5.8
84-
env: RAILS_VERSION='~> 5.2.0'
85-
- rvm: 2.4.10
86-
env: RAILS_VERSION='~> 5.2.0'
87-
- rvm: 2.3.8
88-
env: RAILS_VERSION='~> 5.2.0'
89-
- rvm: 2.2.10
90-
env: RAILS_VERSION='~> 5.2.0'
91-
allow_failure: true
92-
- rvm: 2.2.10
93-
env: RAILS_VERSION='5-2-stable'
94-
95-
# Rails 5.1 Builds >= 2.2.2
96-
- rvm: 2.6.6
97-
env: RAILS_VERSION='~> 5.1.0'
98-
- rvm: 2.5.8
99-
env: RAILS_VERSION='~> 5.1.0'
100-
- rvm: 2.4.10
101-
env: RAILS_VERSION='~> 5.1.0'
102-
- rvm: 2.3.8
103-
env: RAILS_VERSION='~> 5.1.0'
104-
- rvm: 2.2.10
105-
env: RAILS_VERSION='~> 5.1.0'
106-
107-
# Rails 5.0 Builds >= 2.2.2
108-
- rvm: 2.6.6
109-
env: RAILS_VERSION='~> 5.0.0'
110-
- rvm: 2.5.8
111-
env: RAILS_VERSION='~> 5.0.0'
112-
- rvm: 2.4.10
113-
env: RAILS_VERSION='~> 5.0.0'
114-
- rvm: 2.3.8
115-
env: RAILS_VERSION='~> 5.0.0'
116-
- rvm: 2.2.10
117-
env: RAILS_VERSION='~> 5.0.0'
11862

11963
fast_finish: true
64+
65+
branches:
66+
only:
67+
- master
68+
- /^\d+-\d+-maintenance$/
69+
- /^\d+-\d+-dev$/

features/matchers/have_broadcasted_matcher.feature

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Feature: have_broadcasted matcher
1616
it "matches with stream name" do
1717
expect {
1818
ActionCable.server.broadcast(
19-
"notifications", text: 'Hello!'
19+
"notifications", { text: "Hello!" }
2020
)
2121
}.to have_broadcasted_to("notifications")
2222
end
@@ -34,7 +34,7 @@ Feature: have_broadcasted matcher
3434
it "matches with message" do
3535
expect {
3636
ActionCable.server.broadcast(
37-
"notifications", text: 'Hello!'
37+
"notifications", { text: "Hello!" }
3838
)
3939
}.to have_broadcasted_to("notifications").with(text: 'Hello!')
4040
end
@@ -52,7 +52,7 @@ Feature: have_broadcasted matcher
5252
it "matches with message" do
5353
expect {
5454
ActionCable.server.broadcast(
55-
"notifications", text: 'Hello!', user_id: 12
55+
"notifications", { text: 'Hello!', user_id: 12 }
5656
)
5757
}.to have_broadcasted_to("notifications").with(a_hash_including(text: 'Hello!'))
5858
end
@@ -70,7 +70,7 @@ Feature: have_broadcasted matcher
7070
it "matches with message" do
7171
expect {
7272
ActionCable.server.broadcast(
73-
"notifications", text: 'Hello!', user_id: 12
73+
"notifications", { text: 'Hello!', user_id: 12 }
7474
)
7575
}.to have_broadcasted_to("notifications").with { |data|
7676
expect(data['user_id']).to eq 12
@@ -90,7 +90,7 @@ Feature: have_broadcasted matcher
9090
it "matches with stream name" do
9191
expect {
9292
ActionCable.server.broadcast(
93-
"notifications", text: 'Hello!'
93+
"notifications", { text: 'Hello!' }
9494
)
9595
}.to broadcast_to("notifications")
9696
end

lib/rspec/rails/example/mailbox_example_group.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module MailboxExampleGroup
1313
def self.create_inbound_email(arg)
1414
case arg
1515
when Hash
16-
create_inbound_email_from_mail(arg)
16+
create_inbound_email_from_mail(**arg)
1717
else
1818
create_inbound_email_from_source(arg.to_s)
1919
end

spec/generators/rspec/scaffold/scaffold_generator_spec.rb

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Generators are not automatically loaded by Rails
22
require 'generators/rspec/scaffold/scaffold_generator'
33
require 'support/generators'
4+
require 'rspec/support/spec/in_sub_process'
45

56
RSpec.describe Rspec::Generators::ScaffoldGenerator, type: :generator do
7+
include RSpec::Support::InSubProcess
68
setup_default_destination
79

810
describe 'standard request specs' do
@@ -41,12 +43,13 @@
4143
end
4244

4345
describe 'in an engine' do
44-
before do
45-
allow_any_instance_of(::Rails::Generators::NamedBase).to receive(:mountable_engine?).and_return(true)
46-
run_generator %w[posts --request_specs]
46+
it 'generates files with Engine url_helpers' do
47+
in_sub_process do
48+
allow_any_instance_of(::Rails::Generators::NamedBase).to receive(:mountable_engine?).and_return(true)
49+
run_generator %w[posts --request_specs]
50+
is_expected.to contain('Engine.routes.url_helpers')
51+
end
4752
end
48-
49-
it { is_expected.to contain('Engine.routes.url_helpers') }
5053
end
5154
end
5255

0 commit comments

Comments
 (0)