diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2478bab..90ab396 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,11 +4,9 @@ jobs: specs: strategy: matrix: - ruby-version: ['2.7', '3.0', '3.1'] + ruby-version: ['3.0', '3.1'] runs-on: ubuntu-latest - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 @@ -16,5 +14,13 @@ jobs: ruby-version: ${{ matrix.ruby-version }} bundler-cache: true # runs 'bundle install' and caches installed gems automatically - run: bundle exec rake - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + - name: Add coverage to job summary + if: always() && hashFiles('coverage/.last_run.json') != '' + run: | + echo "Line coverage (Ruby ${{ matrix.ruby-version }}): $(jq -r '.result.line' coverage/.last_run.json)%" >> "$GITHUB_STEP_SUMMARY" + - name: Upload coverage report + if: always() && hashFiles('coverage/index.html') != '' + uses: actions/upload-artifact@v4 + with: + name: coverage-ruby-${{ matrix.ruby-version }} + path: coverage/ diff --git a/.rubocop.yml b/.rubocop.yml index e07b9a3..673bd94 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -50,7 +50,7 @@ Style/ClassAndModuleChildren: AllCops: NewCops: disable # TODO: enable - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.0 Exclude: - bin/* - "*.gemspec" diff --git a/Gemfile b/Gemfile index e29ce5e..778cd56 100644 --- a/Gemfile +++ b/Gemfile @@ -6,4 +6,3 @@ source "https://rubygems.org" gemspec gem 'simplecov', require: false, group: :test -gem 'codecov', require: false, group: :test diff --git a/Gemfile.lock b/Gemfile.lock index 35ee1c0..b1ebfd9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -79,8 +79,6 @@ GEM attr_extras (6.2.5) builder (3.2.4) byebug (11.1.3) - codecov (0.6.0) - simplecov (>= 0.15, < 0.22) coderay (1.1.3) concurrent-ruby (1.1.10) crass (1.0.6) @@ -211,7 +209,6 @@ PLATFORMS x86_64-linux DEPENDENCIES - codecov factory_bot graphql_to_rest! pry-byebug diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 18a1508..ff93fe0 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -3,12 +3,9 @@ if ENV['COVERAGE'] || ENV['CI'] require 'simplecov' - if ENV['CI'] - require 'codecov' - SimpleCov.formatter = SimpleCov::Formatter::Codecov + SimpleCov.start do + minimum_coverage 98 if ENV['CI'] end - - SimpleCov.start end require 'graphql_to_rest'