Skip to content

Commit

Permalink
Update CI and add more Rubies to test
Browse files Browse the repository at this point in the history
* add simplecov JSON and lcov reporting
* add all ruby Ruby versions for testing, up to the current release
  - 2.7
  - 3.0
  - 3.1
  - 3.2
  - 3.3
  - 3.4
* switch ubuntu and macos to latest versions
* remove ruby version specification from the `coverge` step, because it
  should use the default/minimum Ruby specified in the `.ruby-version`
* remove the bundler version specification
* update action/checkout step to v4
  • Loading branch information
acant committed Jan 9, 2025
1 parent 7d401fd commit 78747d6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
17 changes: 5 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,25 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-13]
ruby: [2.6, head, jruby, jruby-head]
os: [ubuntu-latest, macos-latest]
ruby: [2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, head, jruby, jruby-head]
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || endsWith(matrix.ruby, 'jruby') }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
# HACK: Continue to use bundler <2 because of Ruby v2.2 support. Once the
# lowest dependency is Ruby v2.3 we can consider upgrading to Bundler 2.x.
bundler: 2.1
bundler-cache: true
- run: bundle exec rake spec
coverage:
needs: [ test ]
name: coverage
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
# HACK: Continue to use bundler <2 because of Ruby v2.2 support. Once the
# lowest dependency is Ruby v2.3 we can consider upgrading to Bundler 2.x.
bundler: 2.1
bundler-cache: true
- run: bundle exec rake
env:
Expand Down
1 change: 1 addition & 0 deletions rspec-side_effects.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rubocop', '~> 0.68.0'
spec.add_development_dependency 'rubocop-rspec'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'simplecov-lcov'
spec.add_development_dependency 'yard'
spec.add_development_dependency 'yardstick'
end
16 changes: 15 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,21 @@

# Setup code coverage
require 'simplecov'
SimpleCov.start
require 'simplecov-lcov'
require 'simplecov_json_formatter'
SimpleCov.start do
# NOTE: Include the lcov formatter for CodeClimate reporting.
# Even though the simplecov JSON format will be output and used by default,
# the test reporter does not handle it reliable.
# Using the lcov formatter is more reliable.
SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new(
[
SimpleCov::Formatter::HTMLFormatter,
SimpleCov::Formatter::JSONFormatter,
SimpleCov::Formatter::LcovFormatter
]
)
end

require 'rspec/side_effects'

Expand Down

0 comments on commit 78747d6

Please sign in to comment.