Skip to content

Commit

Permalink
update codecov report
Browse files Browse the repository at this point in the history
  • Loading branch information
microstudi committed Oct 23, 2023
1 parent 55b1aa5 commit eeac7ac
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests-legacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
pull_request:

env:
CI: 1
SIMPLECOV: 1
NODE_VERSION: 16.9.1
RUBY_VERSION: 2.7.7
BUNDLE_GEMFILE: Gemfile.legacy
Expand Down Expand Up @@ -64,8 +66,6 @@ jobs:
run: bundle exec rspec spec/${{ matrix.rspec }}
env:
FEATURES: ${{ matrix.features }}
SIMPLECOV: 1
CODECOV: 1

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
pull_request:

env:
CI: 1
SIMPLECOV: 1
NODE_VERSION: 16.9.1
RUBY_VERSION: 3.0.6
BUNDLE_GEMFILE: Gemfile
Expand Down Expand Up @@ -64,8 +66,6 @@ jobs:
run: bundle exec rspec spec/${{ matrix.rspec }}
env:
FEATURES: ${{ matrix.features }}
SIMPLECOV: 1
CODECOV: 1

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
Expand Down
22 changes: 14 additions & 8 deletions .simplecov
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# frozen_string_literal: true

SimpleCov.start do
root ENV.fetch("ENGINE_ROOT", nil)
if ENV["SIMPLECOV"]
SimpleCov.start do
# We ignore some of the files because they are never tested
add_filter "/config/"
add_filter "/db/"
add_filter "lib/decidim/decidim_awesome/version.rb"
add_filter "/spec"
end

add_filter "lib/decidim/decidim_awesome/version.rb"
add_filter "/spec"
end

SimpleCov.command_name ENV.fetch("COMMAND_NAME", nil) || File.basename(Dir.pwd)
SimpleCov.merge_timeout 1800

SimpleCov.merge_timeout 1800
if ENV["CI"]
require "simplecov-cobertura"
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
end
end
12 changes: 2 additions & 10 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,12 @@

require "decidim/dev"

require "simplecov"
SimpleCov.start "rails"
if ENV["CODECOV"]
require "codecov"
SimpleCov.formatter = SimpleCov::Formatter::Codecov
end

ENV["ENGINE_ROOT"] = File.dirname(__dir__)

Decidim::Dev.dummy_app_path =
File.expand_path(File.join(__dir__, "decidim_dummy_app"))
Decidim::Dev.dummy_app_path = File.expand_path(File.join(__dir__, "decidim_dummy_app"))

require "decidim/dev/test/base_spec_helper"

def legacy_version?
Decidim::DecidimAwesome.legacy_version?
end
end

0 comments on commit eeac7ac

Please sign in to comment.