From 9c209d78ab75f9e1901308c5e55c5d22557996f3 Mon Sep 17 00:00:00 2001 From: Dmytro Shteflyuk Date: Sat, 14 Oct 2023 11:40:03 -0400 Subject: [PATCH] Report code coverage to CodeClimate --- .github/workflows/tests.yml | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e3ff8b0..ba7ea59 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,14 +12,14 @@ jobs: fail-fast: false matrix: ruby-version: - - "2.7" - - "3.0" +# - "2.7" +# - "3.0" - "3.1" - "3.2" rails-version: - - "6.0" - - "6.1" - - "7.0" +# - "6.0" +# - "6.1" +# - "7.0" - "7.1" - "7.2" include: @@ -27,6 +27,9 @@ jobs: rails-version: "5.1" - ruby-version: "2.7" rails-version: "5.2" + - ruby-version: "3.2" + rails-version: "7.2" + code-coverage: true env: BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails-version }}.gemfile @@ -39,6 +42,17 @@ jobs: ruby-version: ${{ matrix.ruby-version }} bundler-cache: true - name: Run RSpec + env: + CC_TEST_REPORTER_ID: ${{ vars.CC_TEST_REPORTER_ID }} + ENABLE_CODE_COVERAGE: true run: | - bundle exec rspec + bundle exec rspec --format RspecJunitFormatter --out ${{github.workspace}}/rspec-results.xml --format documentation + + - uses: paambaati/codeclimate-action@v5 + if: matrix.code-coverage + env: + CC_TEST_REPORTER_ID: ${{ vars.CC_TEST_REPORTER_ID }} + with: + coverageLocations: | + ${{github.workspace}}/coverage/.resultset.json:simplecov