diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a69ae39..e4e26e2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -56,7 +56,7 @@ jobs: - run: RAILS_ENV=test bundle exec rails assets:precompile name: Precompile assets working-directory: ./spec/decidim_dummy_app/ - - run: bundle exec rspec + - run: CI=1 bundle exec rspec name: RSpec - uses: codecov/codecov-action@v3 - uses: actions/upload-artifact@v3 @@ -65,3 +65,7 @@ jobs: name: screenshots path: ./spec/decidim_dummy_app/tmp/screenshots if-no-files-found: ignore + - uses: coverallsapp/github-action@master + name: Coveralls + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.simplecov b/.simplecov index 9de065b..2f0aec0 100644 --- a/.simplecov +++ b/.simplecov @@ -3,6 +3,8 @@ SimpleCov.start do root ENV.fetch("ENGINE_ROOT", nil) + track_files "{app,lib}/**/*.rb" + add_filter "lib/generators" add_filter "/spec" end diff --git a/Gemfile b/Gemfile index d10e83c..60f0390 100644 --- a/Gemfile +++ b/Gemfile @@ -29,3 +29,7 @@ group :development do gem "spring-watcher-listen", "~> 2.0" gem "web-console", "~> 4.2" end + +group :test do + gem "coveralls_reborn", require: false +end diff --git a/Gemfile.lock b/Gemfile.lock index 04031cd..5a18ced 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -129,6 +129,11 @@ GEM childprocess (5.0.0) commonmarker (0.23.10) concurrent-ruby (1.3.3) + coveralls_reborn (0.28.0) + simplecov (~> 0.22.0) + term-ansicolor (~> 1.7) + thor (~> 1.2) + tins (~> 1.32) crack (1.0.0) bigdecimal rexml @@ -488,6 +493,8 @@ GEM tomlrb mixlib-shellout (3.2.8) chef-utils + mize (0.4.1) + protocol (~> 2.0) msgpack (1.7.2) multi_xml (0.6.0) net-http (0.4.1) @@ -576,6 +583,8 @@ GEM actionmailer (>= 3) net-smtp premailer (~> 1.7, >= 1.7.9) + protocol (2.0.0) + ruby_parser (~> 3.0) psych (4.0.6) stringio public_suffix (6.0.0) @@ -718,6 +727,9 @@ GEM rubyXL (3.4.27) nokogiri (>= 1.10.8) rubyzip (>= 1.3.0) + ruby_parser (3.21.1) + racc (~> 1.5) + sexp_processor (~> 4.16) rubyzip (2.3.2) sass (3.7.4) sass-listen (~> 4.0.0) @@ -732,6 +744,7 @@ GEM websocket (~> 1.0) semantic_range (3.0.0) seven_zip_ruby (1.3.0) + sexp_processor (4.17.2) shakapacker (7.1.0) activesupport (>= 5.2) rack-proxy (>= 0.6.1) @@ -764,12 +777,19 @@ GEM ssrf_filter (1.1.2) stringio (3.1.1) strscan (3.1.0) + sync (0.5.0) temple (0.10.3) + term-ansicolor (1.10.2) + mize + tins (~> 1.0) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) thor (1.3.1) tilt (2.3.0) timeout (0.4.1) + tins (1.33.0) + bigdecimal + sync tomlrb (2.0.3) tzinfo (2.0.6) concurrent-ruby (~> 1.0) @@ -836,6 +856,7 @@ PLATFORMS DEPENDENCIES bootsnap (~> 1.4) byebug (~> 11.0) + coveralls_reborn decidim (~> 0.28.0) decidim-dev (~> 0.28.0) decidim-ub! diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a30b234..e67ff19 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,12 @@ # frozen_string_literal: true require "decidim/dev" +require "simplecov" + +if ENV["CI"] + require "coveralls" + SimpleCov.formatter = Coveralls::SimpleCov::Formatter +end ENV["ENGINE_ROOT"] = File.dirname(__dir__)