diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b155d088f..cf8915161 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,9 @@ on: - "main" workflow_dispatch: +env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + jobs: spec: @@ -19,6 +22,7 @@ jobs: uses: "puppetlabs/cat-github-actions/.github/workflows/gem_ci.yml@main" secrets: "inherit" with: + rake_task: 'spec:coverage' ruby_version: ${{ matrix.ruby_version }} acceptance: diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 420996b33..5e0b99ac9 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,13 +1,17 @@ if ENV.fetch('COVERAGE', nil) == 'yes' - require 'codecov' require 'simplecov' require 'simplecov-console' SimpleCov.formatters = [ SimpleCov::Formatter::HTMLFormatter, SimpleCov::Formatter::Console, - SimpleCov::Formatter::Codecov ] + + if ENV['CI'] == 'true' + require 'codecov' + SimpleCov.formatters << SimpleCov::Formatter::Codecov + end + SimpleCov.start do track_files 'lib/**/*.rb'