Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,29 @@ jobs:
bundle exec rails db:create RAILS_ENV=test
bundle exec rails db:schema:load RAILS_ENV=test

- name: Set up code climate test-reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build

- name: Run tests
run: bundle exec rspec spec/models

- name: Format code coverage report
run: ./cc-test-reporter format-coverage -t simplecov -o "coverage/codeclimate.models.json" --debug

- name: Upload coverage artifacts
uses: actions/upload-artifact@v4
with:
name: code-coverage-artifacts
path: coverage/

- name: Publish code coverage
run: |
./cc-test-reporter sum-coverage coverage/codeclimate.*.json
./cc-test-reporter after-build -t simplecov -r ${{ secrets.CC_TEST_REPORTER_ID }}

docker:
needs: test
if: github.ref == 'refs/heads/main'
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ group :development, :test do
gem 'rswag-specs'
gem 'rubocop'
gem 'simplecov', require: false, group: :test
gem 'coveralls'
gem 'simplecov_json_formatter'
end

group :development do
Expand Down
31 changes: 31 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,25 @@ GEM
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
bcrypt (3.1.19)
bigdecimal (3.1.9)
bootsnap (1.16.0)
msgpack (~> 1.2)
builder (3.2.4)
concurrent-ruby (1.2.2)
coveralls (0.7.1)
multi_json (~> 1.3)
rest-client
simplecov (>= 0.7)
term-ansicolor
thor
crass (1.0.6)
date (3.3.3)
debug (1.8.0)
irb (>= 1.5.0)
reline (>= 0.3.1)
diff-lcs (1.5.0)
docile (1.4.0)
domain_name (0.6.20240107)
erubi (1.12.0)
factory_bot (6.2.1)
activesupport (>= 5.0.0)
Expand All @@ -93,6 +101,9 @@ GEM
activerecord (>= 3)
globalid (1.1.0)
activesupport (>= 5.0)
http-accept (1.7.0)
http-cookie (1.0.8)
domain_name (~> 0.5)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
io-console (0.6.0)
Expand All @@ -104,6 +115,7 @@ GEM
jwt (2.7.1)
language_server-protocol (3.17.0.3)
lingua (0.6.2)
logger (1.6.6)
loofah (2.21.3)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand All @@ -114,9 +126,14 @@ GEM
net-smtp
marcel (1.0.2)
method_source (1.0.0)
mime-types (3.6.0)
logger
mime-types-data (~> 3.2015)
mime-types-data (3.2025.0204)
mini_mime (1.1.5)
minitest (5.19.0)
msgpack (1.7.2)
multi_json (1.15.0)
mysql2 (0.5.5)
net-imap (0.3.7)
date
Expand All @@ -127,6 +144,7 @@ GEM
timeout
net-smtp (0.3.3)
net-protocol
netrc (0.11.0)
nio4r (2.5.9)
nokogiri (1.15.2-aarch64-linux)
racc (~> 1.4)
Expand Down Expand Up @@ -182,6 +200,11 @@ GEM
regexp_parser (2.8.1)
reline (0.3.7)
io-console (~> 0.5)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.2.6)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
Expand Down Expand Up @@ -231,8 +254,14 @@ GEM
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
spring (4.1.1)
sync (0.5.0)
term-ansicolor (1.11.2)
tins (~> 1.0)
thor (1.2.2)
timeout (0.4.0)
tins (1.38.0)
bigdecimal
sync
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
tzinfo-data (1.2023.3)
Expand All @@ -252,6 +281,7 @@ PLATFORMS
DEPENDENCIES
bcrypt (~> 3.1.7)
bootsnap
coveralls
debug
factory_bot_rails
faker
Expand All @@ -268,6 +298,7 @@ DEPENDENCIES
rswag-ui
rubocop
simplecov
simplecov_json_formatter
spring
tzinfo-data

Expand Down
11 changes: 11 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@
# it.
#
# See https://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
require 'simplecov'
require 'coveralls'
require "simplecov_json_formatter"
Coveralls.wear! 'rails'
SimpleCov.formatter = SimpleCov::Formatter::JSONFormatter
# SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
# SimpleCov::Formatter::HTMLFormatter,
# Coveralls::SimpleCov::Formatter
# ])

SimpleCov.start 'rails'

RSpec.configure do |config|
# rspec-expectations config goes here. You can use an alternate
Expand Down