diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7c46fce..f9308ee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: ['2.0', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3', 'jruby'] + ruby-version: ['2.1', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3', '3.4', 'jruby'] steps: - uses: actions/checkout@v3 @@ -36,7 +36,8 @@ jobs: - name: Run tests run: bundle exec rake test - name: Submit code coverage results - uses: paambaati/codeclimate-action@v3.2.0 + uses: paambaati/codeclimate-action@v9.0.0 + if: matrix.ruby-version != '2.1' env: CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_REPO_TOKEN }} diff --git a/discid.gemspec b/discid.gemspec index 9fbb573..f610f5d 100644 --- a/discid.gemspec +++ b/discid.gemspec @@ -15,7 +15,7 @@ Gem::Specification.new do |spec| spec.post_install_message = %q{Please make sure you have libdiscid (http://musicbrainz.org/doc/libdiscid) installed.} spec.requirements = "libdiscid >= 0.1.0" - spec.required_ruby_version = ">= 2.0" + spec.required_ruby_version = ">= 2.1" spec.required_rubygems_version = ">= 1.3.6" spec.files = Dir['{lib,examples,test}/**/*.rb'] + @@ -31,5 +31,10 @@ Gem::Specification.new do |spec| spec.add_development_dependency "yard" spec.add_development_dependency "redcarpet" if not RUBY_PLATFORM == "java" spec.add_development_dependency "test-unit" - spec.add_development_dependency "simplecov", "< 0.18" + + # The code coverage is only supported for Ruby >= 2.4 + if (RUBY_VERSION.split('.').map{|s|s.to_i} <=> [2, 4, 0]) >= 0 + spec.add_development_dependency "simplecov" + spec.add_development_dependency "simplecov_json_formatter" + end end diff --git a/test/helper.rb b/test/helper.rb index 8dc5991..49b40f4 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,4 +1,4 @@ -# Copyright (C) 2013-2014 Philipp Wolfer +# Copyright (C) 2013-2014, 2025 Philipp Wolfer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by @@ -15,10 +15,12 @@ begin require 'simplecov' + require "simplecov_json_formatter" + SimpleCov.formatter = SimpleCov::Formatter::JSONFormatter SimpleCov.start do add_filter "/test/" end rescue LoadError - puts 'WARNING: codeclimate-test-reporter not available, no code coverage reported.' + puts 'WARNING: simplecov not available, no code coverage reported.' end