Use GitHub Actions to upload Coveralls report

This commit is contained in:
Patrick Gansterer 2021-02-18 13:18:31 +01:00
parent f7c7b56bd0
commit 434cc59ae8
4 changed files with 17 additions and 25 deletions

View file

@ -50,6 +50,10 @@ jobs:
- name: Run tests - name: Run tests
run: bundle exec rake rspec-rerun:spec run: bundle exec rake rspec-rerun:spec
env: env:
COVERALLS: 1 COVERAGE: lcov
DATABASE_URL: mysql2://user:password@127.0.0.1/test DATABASE_URL: mysql2://user:password@127.0.0.1/test
RAILS_ENV: test RAILS_ENV: test
- name: Upload coverage report to Coveralls
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

View file

@ -111,7 +111,7 @@ group :test do
gem 'i18n-spec' gem 'i18n-spec'
# code coverage # code coverage
gem 'simplecov', require: false gem 'simplecov', require: false
gem 'coveralls', require: false gem 'simplecov-lcov', require: false
# api # api
gem 'apivore', require: false gem 'apivore', require: false
gem 'hashie', '~> 3.4.6', require: false # https://github.com/westfieldlabs/apivore/issues/114 gem 'hashie', '~> 3.4.6', require: false # https://github.com/westfieldlabs/apivore/issues/114

View file

@ -166,12 +166,6 @@ GEM
concurrent-ruby (1.1.7) concurrent-ruby (1.1.7)
connection_pool (2.2.3) connection_pool (2.2.3)
content_for_in_controllers (0.0.2) content_for_in_controllers (0.0.2)
coveralls (0.7.1)
multi_json (~> 1.3)
rest-client
simplecov (>= 0.7)
term-ansicolor
thor
crass (1.0.6) crass (1.0.6)
daemons (1.3.1) daemons (1.3.1)
database_cleaner (1.8.5) database_cleaner (1.8.5)
@ -186,8 +180,6 @@ GEM
diff-lcs (1.4.4) diff-lcs (1.4.4)
diffy (3.4.0) diffy (3.4.0)
docile (1.3.2) docile (1.3.2)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
doorkeeper (5.4.0) doorkeeper (5.4.0)
railties (>= 5) railties (>= 5)
doorkeeper-i18n (5.2.2) doorkeeper-i18n (5.2.2)
@ -232,9 +224,6 @@ GEM
nokogiri (>= 1.6.0) nokogiri (>= 1.6.0)
ruby_parser (~> 3.5) ruby_parser (~> 3.5)
htmlentities (4.3.4) htmlentities (4.3.4)
http-accept (1.7.0)
http-cookie (1.0.3)
domain_name (~> 0.5)
i18n (1.8.5) i18n (1.8.5)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
i18n-js (3.0.11) i18n-js (3.0.11)
@ -315,7 +304,6 @@ GEM
mustermann (1.1.1) mustermann (1.1.1)
ruby2_keywords (~> 0.0.1) ruby2_keywords (~> 0.0.1)
mysql2 (0.5.3) mysql2 (0.5.3)
netrc (0.11.0)
nio4r (2.5.2) nio4r (2.5.2)
nokogiri (1.10.10) nokogiri (1.10.10)
mini_portile2 (~> 2.4.0) mini_portile2 (~> 2.4.0)
@ -412,11 +400,6 @@ GEM
redis-namespace (~> 1.6) redis-namespace (~> 1.6)
sinatra (>= 0.9.2) sinatra (>= 0.9.2)
vegas (~> 0.1.2) vegas (~> 0.1.2)
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)
roo (2.8.3) roo (2.8.3)
nokogiri (~> 1) nokogiri (~> 1)
rubyzip (>= 1.3.0, < 3.0.0) rubyzip (>= 1.3.0, < 3.0.0)
@ -479,6 +462,7 @@ GEM
docile (~> 1.1) docile (~> 1.1)
simplecov-html (~> 0.11) simplecov-html (~> 0.11)
simplecov-html (0.12.2) simplecov-html (0.12.2)
simplecov-lcov (0.8.0)
sinatra (2.1.0) sinatra (2.1.0)
mustermann (~> 1.0) mustermann (~> 1.0)
rack (~> 2.2) rack (~> 2.2)
@ -499,10 +483,7 @@ GEM
sqlite3 (1.3.13) sqlite3 (1.3.13)
sqlite3-ruby (1.3.3) sqlite3-ruby (1.3.3)
sqlite3 (>= 1.3.3) sqlite3 (>= 1.3.3)
sync (0.5.0)
temple (0.8.2) temple (0.8.2)
term-ansicolor (1.7.1)
tins (~> 1.0)
therubyracer (0.12.3) therubyracer (0.12.3)
libv8 (~> 3.16.14.15) libv8 (~> 3.16.14.15)
ref ref
@ -513,8 +494,6 @@ GEM
thor (1.0.1) thor (1.0.1)
thread_safe (0.3.6) thread_safe (0.3.6)
tilt (2.0.10) tilt (2.0.10)
tins (1.25.0)
sync
ttfunk (1.6.2.1) ttfunk (1.6.2.1)
twitter-bootstrap-rails (2.2.8) twitter-bootstrap-rails (2.2.8)
actionpack (>= 3.1) actionpack (>= 3.1)
@ -569,7 +548,6 @@ DEPENDENCIES
bullet bullet
capybara capybara
connection_pool connection_pool
coveralls
daemons daemons
database_cleaner database_cleaner
date_time_attribute date_time_attribute
@ -630,6 +608,7 @@ DEPENDENCIES
simple-navigation-bootstrap simple-navigation-bootstrap
simple_form simple_form
simplecov simplecov
simplecov-lcov
spreadsheet spreadsheet
sprockets (< 4) sprockets (< 4)
sqlite3 (~> 1.3.6) sqlite3 (~> 1.3.6)

View file

@ -58,6 +58,15 @@ RSpec.configure do |config|
config.infer_spec_type_from_file_location! config.infer_spec_type_from_file_location!
end end
if ENV['COVERAGE'] == 'lcov'
require 'simplecov-lcov'
SimpleCov::Formatter::LcovFormatter.config do |c|
c.report_with_single_file = true
c.single_report_path = 'coverage/lcov.info'
end
SimpleCov.formatters = SimpleCov::Formatter::LcovFormatter
end
# include default foodsoft scope in urls, so that *_path works # include default foodsoft scope in urls, so that *_path works
# https://github.com/rspec/rspec-rails/issues/255 # https://github.com/rspec/rspec-rails/issues/255
class ActionDispatch::Routing::RouteSet class ActionDispatch::Routing::RouteSet