Skip to content

Commit

Permalink
ci: Simplify codecov integration
Browse files Browse the repository at this point in the history
  • Loading branch information
ixti committed Dec 12, 2023
1 parent 7c8f364 commit 60df1e3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 42 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,31 +38,6 @@ jobs:

- run: bundle exec rake test

- name: "Upload coverage results"
uses: actions/upload-artifact@v3
with:
name: coverage-${{ matrix.ruby }}
path: coverage/.resultset.json

test-coverage:
runs-on: ubuntu-latest
needs: test

steps:
- uses: actions/checkout@v4

- uses: ruby/setup-ruby@v1
with:
ruby-version: ruby-3.2
bundler-cache: true

- name: "Download coverage results"
uses: actions/download-artifact@v3
with:
path: coverage

- run: bundle exec rake test:coverage

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
Expand Down
3 changes: 2 additions & 1 deletion .simplecov
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ SimpleCov.start do
enable_coverage :branch

if ENV["CI"]
formatter SimpleCov::Formatter::SimpleFormatter
require "simplecov-cobertura"
formatter SimpleCov::Formatter::CoberturaFormatter
else
formatter SimpleCov::Formatter::MultiFormatter.new([
SimpleCov::Formatter::SimpleFormatter,
Expand Down
16 changes: 0 additions & 16 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,6 @@ task :test do
end
end

namespace :test do
desc "Generate test coverage report"
task :coverage do
require "simplecov"

SimpleCov.collate Dir["coverage/**/.resultset.json"] do
if ENV["CI"]
require "simplecov-cobertura"
formatter SimpleCov::Formatter::CoberturaFormatter
else
formatter SimpleCov::Formatter::HTMLFormatter
end
end
end
end

desc "Lint codebase"
task :lint do
sh "bundle exec rubocop --color"
Expand Down

0 comments on commit 60df1e3

Please sign in to comment.