From d98c1b214ee75128ac1603812d1508abc9a86da6 Mon Sep 17 00:00:00 2001 From: Andrejs Cunskis Date: Sun, 9 Jun 2024 11:04:23 +0300 Subject: [PATCH 1/3] Update ruby dev version to 3.3.2 --- .ruby-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ruby-version b/.ruby-version index ff365e0..4772543 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.1.3 +3.3.2 From c3b4722997e237c47f78b0909d84af0aea4adf25 Mon Sep 17 00:00:00 2001 From: Andrejs Cunskis Date: Sun, 9 Jun 2024 11:05:48 +0300 Subject: [PATCH 2/3] Drop support for ruby 2.7, 3.0 --- .github/workflows/test.yml | 2 +- .rubocop.yml | 2 +- sidekiq_alive.gemspec | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2894e56..88d9ce1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -69,7 +69,7 @@ jobs: 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` diff --git a/.rubocop.yml b/.rubocop.yml index 55e4a4a..b06e989 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,7 +2,7 @@ inherit_gem: rubocop-shopify: rubocop.yml AllCops: - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.1 SuggestExtensions: false NewCops: enable diff --git a/sidekiq_alive.gemspec b/sidekiq_alive.gemspec index 8a0e398..6dbe98c 100644 --- a/sidekiq_alive.gemspec +++ b/sidekiq_alive.gemspec @@ -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." From e90fdae2a0b1e72cbf5690d43ba1f961cd9d5091 Mon Sep 17 00:00:00 2001 From: Andrejs Cunskis Date: Sun, 9 Jun 2024 11:22:33 +0300 Subject: [PATCH 3/3] Add coverage action Fix rubocop violation Do not fail on coverage Add min threshold Update conditional Update coverage options Do not fail on coverage --- .github/workflows/test.yml | 55 +++++++++----------------------------- Gemfile | 2 +- lib/sidekiq_alive.rb | 2 +- 3 files changed, 14 insertions(+), 45 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 88d9ce1..682f4f4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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/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 @@ -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 diff --git a/Gemfile b/Gemfile index 63b1dca..58aff3a 100644 --- a/Gemfile +++ b/Gemfile @@ -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" diff --git a/lib/sidekiq_alive.rb b/lib/sidekiq_alive.rb index 9e044e7..a2af5dc 100644 --- a/lib/sidekiq_alive.rb +++ b/lib/sidekiq_alive.rb @@ -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