Skip to content

Commit

Permalink
aggregate and publish coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
HoneyryderChuck committed Jan 4, 2025
1 parent b196ac3 commit a8cf353
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,39 @@ jobs:
path: coverage/
include-hidden-files: true

coverage:
needs: test
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write

steps:
- uses: actions/checkout@v4

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4
bundler-cache: true

- name: Download coverage results
uses: actions/download-artifact@v4
with:
pattern: coverage-*
path: coverage

- name: coverage
env:
CI: 1
run: |
find coverage -name "*resultset.json" -exec sed -i 's?${{ github.workspace }}?'`pwd`'?' {} \;
bundle exec rake coverage:report
- uses: joshmfrankel/simplecov-check-action@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Publish coverage report
uses: actions/deploy-pages@v4
id: deployment
12 changes: 12 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ require "rubocop/rake_task"

RuboCop::RakeTask.new

namespace :coverage do
desc "Aggregates coverage reports"
task :report do
return unless ENV.key?("CI")

require "simplecov"

puts Dir["coverage/**/.resultset.json"].inspect
SimpleCov.collate Dir["coverage/**/.resultset.json"]
end
end

if RUBY_ENGINE == "ruby" && RUBY_VERSION > "3.0.0" && !Gem.win_platform?
task :type_check do
# Steep doesn't provide Rake integration yet,
Expand Down

0 comments on commit a8cf353

Please sign in to comment.