Skip to content

Commit

Permalink
Add coverage action
Browse files Browse the repository at this point in the history
Fix rubocop violation

Do not fail on coverage

Add min threshold

Update conditional

Update coverage options

Do not fail on coverage
  • Loading branch information
andrcuns committed Jun 9, 2024
1 parent c3b4722 commit e90fdae
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 45 deletions.
55 changes: 12 additions & 43 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,49 +20,6 @@ jobs:
cache-version: 1
- name: Run lint
run: bundle exec rubocop --color
coverage:
runs-on: ubuntu-latest
services:
# Label used to access the service container
redis:
# Docker Hub image
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps port 6379 on service container to the host
- 6379:6379
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
cache-version: 1
- name: Run tests
run: bundle exec rspec --force-color
# - name: Code Coverage Summary
# uses: irongut/[email protected]
# with:
# filename: coverage/coverage.xml
# badge: true
# fail_below_min: true
# format: markdown
# hide_branch_rate: false
# hide_complexity: true
# indicators: true
# output: both
# # thresholds: '60 80'
# - name: Add Coverage PR Comment
# uses: marocchino/sticky-pull-request-comment@v2
# if: github.event_name == 'pull_request'
# with:
# recreate: true
# path: code-coverage-results.md
test:
runs-on: ubuntu-latest
needs: rubocop
Expand Down Expand Up @@ -103,3 +60,15 @@ jobs:
env:
SIDEKIQ_VERSION_RANGE: ${{ matrix.sidekiq-version }}
WITH_RACKUP: ${{ matrix.with-rackup }}
- name: Add coverage report
uses: insightsengineering/coverage-action@v2
# TODO: Add coverage merging from different test runs
if: ${{ matrix.ruby-version == '3.3' && matrix.sidekiq-version == '~> 7' && matrix.with-rackup == false }}
with:
path: coverage/coverage.xml
publish: true
threshold: 90
pycobertura-exception-failure: false
diff: true
diff-branch: master
coverage-reduction-failure: true
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ gem "ruby-lsp", "~> 0.14.0", group: :development

group :test do
gem "simplecov", require: false
gem "simplecov-cobertura"
gem "simplecov-cobertura", require: false

# used for testing rack based server
gem "rack-test", "~> 2.1.0"
Expand Down
2 changes: 1 addition & 1 deletion lib/sidekiq_alive.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def startup_info
end

def successful_startup_text
"Successfully started sidekiq-alive, registered with key: "\
"Successfully started sidekiq-alive, registered with key: " \
"#{current_instance_register_key} on set #{HOSTNAME_REGISTRY}"
end

Expand Down

0 comments on commit e90fdae

Please sign in to comment.