Skip to content

Commit 9217638

Browse files
authored
Merge pull request #2404 from rspec/move-to-github-actions
Move MRI build to Github Actions
2 parents 934276b + 029416b commit 9217638

File tree

5 files changed

+113
-59
lines changed

5 files changed

+113
-59
lines changed

.github/workflows/ci.yml

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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.0 builds >= 2.5.0
20+
- ruby: 3.0.0-preview1
21+
env:
22+
RAILS_VERSION: '~> 6.0.0'
23+
- ruby: 2.7
24+
env:
25+
RAILS_VERSION: '~> 6.0.0'
26+
- ruby: 2.6
27+
env:
28+
RAILS_VERSION: '~> 6.0.0'
29+
- ruby: 2.5
30+
env:
31+
RAILS_VERSION: '~> 6.0.0'
32+
# Rails 5.2 builds >= 2.2.2
33+
- ruby: 2.6.6
34+
env:
35+
RAILS_VERSION: '~> 5.2.0'
36+
- ruby: 2.5.8
37+
env:
38+
RAILS_VERSION: '~> 5.2.0'
39+
- ruby: 2.4.10
40+
env:
41+
RAILS_VERSION: '~> 5.2.0'
42+
- ruby: 2.3.8
43+
env:
44+
RAILS_VERSION: '~> 5.2.0'
45+
- ruby: 2.2.10
46+
allow_failure: true
47+
env:
48+
RAILS_VERSION: '~> 5.2.0'
49+
- ruby: 2.2.10
50+
env:
51+
RAILS_VERSION: '5-2-stable'
52+
# Rails 5.1 Builds >= 2.2.2
53+
- ruby: 2.6.6
54+
env:
55+
RAILS_VERSION: '~> 5.1.0'
56+
- ruby: 2.5.8
57+
env:
58+
RAILS_VERSION: '~> 5.1.0'
59+
- ruby: 2.4.10
60+
env:
61+
RAILS_VERSION: '~> 5.1.0'
62+
- ruby: 2.3.8
63+
env:
64+
RAILS_VERSION: '~> 5.1.0'
65+
- ruby: 2.2.10
66+
env:
67+
RAILS_VERSION: '~> 5.1.0'
68+
# Rails 5.0 Builds >= 2.2.2
69+
- ruby: 2.6.6
70+
env:
71+
RAILS_VERSION: '~> 5.0.0'
72+
- ruby: 2.5.8
73+
env:
74+
RAILS_VERSION: '~> 5.0.0'
75+
- ruby: 2.4.10
76+
env:
77+
RAILS_VERSION: '~> 5.0.0'
78+
- ruby: 2.3.8
79+
env:
80+
RAILS_VERSION: '~> 5.0.0'
81+
- ruby: 2.2.10
82+
env:
83+
RAILS_VERSION: '~> 5.0.0'
84+
env: ${{ matrix.env }}
85+
steps:
86+
- uses: actions/checkout@v2
87+
- uses: ruby/setup-ruby@v1
88+
with:
89+
ruby-version: ${{ matrix.ruby }}
90+
- run: script/clone_all_rspec_repos
91+
- run: bundle install --binstubs
92+
- run: script/run_build
93+
continue-on-error: ${{ matrix.allow_failure || false }}

.travis.yml

+6-48
Original file line numberDiff line numberDiff line change
@@ -38,66 +38,24 @@ script: "script/run_build 2>&1"
3838

3939
matrix:
4040
include:
41-
# Rails 6.0 builds >= 2.5.0
4241
- rvm: jruby-head
4342
jdk: oraclejdk11
4443
env:
4544
- RAILS_VERSION='~> 6.0.0'
4645
- JRUBY_OPT=--dev
4746
- 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"
48-
- rvm: ruby-3.0.0-preview1
49-
env: RAILS_VERSION='~> 6.0.0'
50-
allow_failure: true
51-
- rvm: 2.7.1
52-
env: RAILS_VERSION='~> 6.0.0'
53-
- rvm: 2.6.6
54-
env: RAILS_VERSION='~> 6.0.0'
55-
- rvm: 2.5.8
56-
env: RAILS_VERSION='~> 6.0.0'
5747

58-
# Rails 5.2 builds >= 2.2.2
5948
- rvm: jruby-head
6049
jdk: oraclejdk11
6150
env:
6251
- RAILS_VERSION='~> 5.2.0'
6352
- JRUBY_OPT=--dev
6453
- 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"
65-
- rvm: 2.6.6
66-
env: RAILS_VERSION='~> 5.2.0'
67-
- rvm: 2.5.8
68-
env: RAILS_VERSION='~> 5.2.0'
69-
- rvm: 2.4.10
70-
env: RAILS_VERSION='~> 5.2.0'
71-
- rvm: 2.3.8
72-
env: RAILS_VERSION='~> 5.2.0'
73-
- rvm: 2.2.10
74-
env: RAILS_VERSION='~> 5.2.0'
75-
allow_failure: true
76-
- rvm: 2.2.10
77-
env: RAILS_VERSION='5-2-stable'
78-
79-
# Rails 5.1 Builds >= 2.2.2
80-
- rvm: 2.6.6
81-
env: RAILS_VERSION='~> 5.1.0'
82-
- rvm: 2.5.8
83-
env: RAILS_VERSION='~> 5.1.0'
84-
- rvm: 2.4.10
85-
env: RAILS_VERSION='~> 5.1.0'
86-
- rvm: 2.3.8
87-
env: RAILS_VERSION='~> 5.1.0'
88-
- rvm: 2.2.10
89-
env: RAILS_VERSION='~> 5.1.0'
90-
91-
# Rails 5.0 Builds >= 2.2.2
92-
- rvm: 2.6.6
93-
env: RAILS_VERSION='~> 5.0.0'
94-
- rvm: 2.5.8
95-
env: RAILS_VERSION='~> 5.0.0'
96-
- rvm: 2.4.10
97-
env: RAILS_VERSION='~> 5.0.0'
98-
- rvm: 2.3.8
99-
env: RAILS_VERSION='~> 5.0.0'
100-
- rvm: 2.2.10
101-
env: RAILS_VERSION='~> 5.0.0'
10254

10355
fast_finish: true
56+
57+
branches:
58+
only:
59+
- master
60+
- /^\d+-\d+-maintenance$/
61+
- /^\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)