Skip to content

Commit

Permalink
ci: conditionally run coverage
Browse files Browse the repository at this point in the history
Truffleruby tests seem to have an issue with calculating coverage.
Only run coverage when we need it.
  • Loading branch information
irphilli committed Jan 24, 2023
1 parent bab36ed commit 8debd3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ruby-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Set environment
run: echo "COVERAGE=true" >> "$GITHUB_ENV"
if: matrix.ruby-version == '3.1' && matrix.gemfile == 'faraday-2'
- name: Install dependencies
run: bundle install
- name: Run tests
Expand Down
6 changes: 4 additions & 2 deletions test/minitest_helper.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#Bundler.require(:test)
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)

require 'simplecov'
SimpleCov.start
if ENV['COVERAGE'] == 'true'
require 'simplecov'
SimpleCov.start
end

require 'minitest/byebug' if ENV['DEBUG']
require 'minitest/autorun'
Expand Down

0 comments on commit 8debd3f

Please sign in to comment.