It's now recommended to use reviewdog-action-code-coverage instead of this approach.
undercover-checkstyle
Installation
Add this line to your application's Gemfile:
gem 'undercover-checkstyle'
And then execute:
$ bundle install
Usage
Setting up required LCOV reporting
bundle exec undercover-checkstyle
GitHub Actions Example
reviewdog.yml
runner:
undercover:
cmd: bundle exec undercover-checkstyle --compare origin/master
level: warning
format: checkstyle
.github/workflows/ruby.yml
name: Ruby
on:
pull_request:
jobs:
rspec:
runs-on: ubuntu-latest
env:
RUBYOPT: -EUTF-8
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Rspec
run: bundle exec rspec
- uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
# NOTE: Uncommenting removes every past `undercover` comment
# - uses: aki77/delete-pr-comments-action@v1
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# bodyContains: "[undercover]"
# noReply: "true"
- name: Run reviewdog
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git fetch --no-tags
reviewdog -reporter=github-pr-review -runners=undercover