Skip to content

Commit b8c5268

Browse files
authored
Merge pull request #6348 from tvdeyen/rspec-github-formatter
feat(CI): Use rspec-github formatter
2 parents 30b7b04 + b259540 commit b8c5268

File tree

9 files changed

+40
-1
lines changed

9 files changed

+40
-1
lines changed

.github/workflows/test_solidus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
run: |
9999
cd ${{ inputs.lib_name }}
100100
bundle exec rake test_app
101-
bundle exec rspec --profile 10 --format progress
101+
bundle exec rspec --profile 10 --format progress --format RSpec::Github::Formatter
102102
- name: Upload coverage report to Codecov
103103
uses: codecov/codecov-action@v5
104104
if: ${{ steps.setup-coverage.outputs.coverage == 'true' }}

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ gem 'rspec_junit_formatter', require: false
3636
gem 'yard', require: false
3737
gem 'db-query-matchers', require: false
3838

39+
if ENV['GITHUB_ACTIONS']
40+
gem "rspec-github", "~> 3.0", require: false
41+
end
42+
3943
# Ensure the requirement is also updated in core/lib/spree/testing_support/factory_bot.rb
4044
gem 'factory_bot_rails', '>= 4.8', require: false
4145

admin/spec/spec_helper.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@
8787
end
8888

8989
RSpec.configure do |config|
90+
if ENV["GITHUB_ACTIONS"]
91+
require "rspec/github"
92+
config.add_formatter RSpec::Github::Formatter
93+
end
94+
9095
config.color = true
9196
config.infer_spec_type_from_file_location!
9297
config.expect_with :rspec do |c|

api/spec/spec_helper.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@
4848
Spree::TestingSupport::FactoryBot.add_paths_and_load!
4949

5050
RSpec.configure do |config|
51+
if ENV["GITHUB_ACTIONS"]
52+
require "rspec/github"
53+
config.add_formatter RSpec::Github::Formatter
54+
end
55+
5156
config.backtrace_exclusion_patterns = [/gems\/activesupport/, /gems\/actionpack/, /gems\/rspec/]
5257
config.color = true
5358
config.infer_spec_type_from_file_location!

backend/spec/spec_helper.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@
6565
Spree::TestingSupport::FactoryBot.add_paths_and_load!
6666

6767
RSpec.configure do |config|
68+
if ENV["GITHUB_ACTIONS"]
69+
require "rspec/github"
70+
config.add_formatter RSpec::Github::Formatter
71+
end
72+
6873
config.color = true
6974
config.infer_spec_type_from_file_location!
7075
config.expect_with :rspec do |c|

core/spec/spec_helper.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
require 'spree/config'
2525

2626
RSpec.configure do |config|
27+
if ENV["GITHUB_ACTIONS"]
28+
require "rspec/github"
29+
config.add_formatter RSpec::Github::Formatter
30+
end
31+
2732
config.disable_monkey_patching!
2833
config.color = true
2934
config.expect_with :rspec do |c|

legacy_promotions/spec/spec_helper.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
require "solidus_legacy_promotions"
2727

2828
RSpec.configure do |config|
29+
if ENV["GITHUB_ACTIONS"]
30+
require "rspec/github"
31+
config.add_formatter RSpec::Github::Formatter
32+
end
33+
2934
config.disable_monkey_patching!
3035
config.color = true
3136
config.expect_with :rspec do |c|

promotions/spec/spec_helper.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
Spree::Config.promotions = SolidusPromotions.configuration
3030

3131
RSpec.configure do |config|
32+
if ENV["GITHUB_ACTIONS"]
33+
require "rspec/github"
34+
config.add_formatter RSpec::Github::Formatter
35+
end
36+
3237
config.disable_monkey_patching!
3338
config.color = true
3439
config.expect_with :rspec do |c|

sample/spec/spec_helper.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
require 'database_cleaner'
1616

1717
RSpec.configure do |config|
18+
if ENV["GITHUB_ACTIONS"]
19+
require "rspec/github"
20+
config.add_formatter RSpec::Github::Formatter
21+
end
22+
1823
config.color = true
1924
config.infer_spec_type_from_file_location!
2025
config.expect_with :rspec do |c|

0 commit comments

Comments
 (0)