diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4db11632..4ab66428 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,9 +18,9 @@ jobs: - ruby: "2.6" - ruby: "2.7" - ruby: "3.0" - coverage: "yes" + codecov: "yes" env: - COVERAGE: ${{ matrix.coverage }} + CODECOV: ${{ matrix.codecov }} steps: - uses: actions/checkout@v2 - name: Install Ruby ${{ matrix.ruby }} diff --git a/.simplecov b/.simplecov index 93a675b8..9023bf38 100644 --- a/.simplecov +++ b/.simplecov @@ -1,20 +1,18 @@ -begin - require 'simplecov' - require 'simplecov-console' - require 'codecov' -rescue LoadError -else - SimpleCov.start do - track_files 'lib/**/*.rb' +SimpleCov.start do + track_files 'lib/**/*.rb' + + add_filter '/spec' - add_filter '/spec' + enable_coverage :branch - enable_coverage :branch + # do not track vendored files + add_filter '/vendor' + add_filter '/.vendor' +end - # do not track vendored files - add_filter '/vendor' - add_filter '/.vendor' - end +if ENV['CODECOV'] + require 'simplecov-console' + require 'codecov' SimpleCov.formatters = [ SimpleCov::Formatter::Console, diff --git a/Gemfile b/Gemfile index 42a7f317..c2c70247 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ group :release do gem 'github_changelog_generator', :require => false end -group :coverage, optional: ENV['COVERAGE']!='yes' do +group :coverage, optional: ENV['CODECOV']!='yes' do gem 'simplecov-console', :require => false gem 'codecov', :require => false end