Skip to content

Commit

Permalink
Merge pull request #126 from arturictus/bump-dev-ruby
Browse files Browse the repository at this point in the history
Drop old ruby support and fix coverage publishing
  • Loading branch information
arturictus authored Jun 11, 2024
2 parents 5ae87c7 + e90fdae commit a531833
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 49 deletions.
57 changes: 13 additions & 44 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,56 +20,13 @@ 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/CodeCoverageSummary@v1.3.0
# 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
strategy:
fail-fast: false
matrix:
ruby-version: ["3.2", "3.1", "3.0"]
ruby-version: ["3.3", "3.2", "3.1"]
sidekiq-version: ["~> 6.5", "~> 7"]
with-rackup: [true, false]
# Service containers to run with `runner-job`
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 .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ inherit_gem:
rubocop-shopify: rubocop.yml

AllCops:
TargetRubyVersion: 2.7
TargetRubyVersion: 3.1
SuggestExtensions: false
NewCops: enable

Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.3
3.3.2
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
2 changes: 1 addition & 1 deletion sidekiq_alive.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gem::Specification.new do |spec|

spec.version = SidekiqAlive::VERSION

spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
spec.required_ruby_version = Gem::Requirement.new(">= 3.1")

spec.homepage = "https://github.com/arturictus/sidekiq_alive"
spec.summary = "Liveness probe for sidekiq on Kubernetes deployments."
Expand Down

0 comments on commit a531833

Please sign in to comment.