From 78b51bc20fdc321a980047e3231e7a5fd63bf6c4 Mon Sep 17 00:00:00 2001 From: Matt Cruz Date: Fri, 29 Nov 2024 21:32:42 -0500 Subject: [PATCH] Add coverage report --- .github/workflows/test.yml | 44 ++++++++++++++++++++++++++++++++------ Gemfile | 4 ++-- 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3fd08ef..24c9614 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -100,15 +100,15 @@ jobs: - 3.2.5 - 3.3.5 rails: - - '~> 7.0.0' - - '~> 7.1.0' - - '~> 8.0.0' + - 7.0.0 + - 7.1.0 + - 8.0.0 include: - ruby: 3.1.6 - rails: '~> 7.0.0' + rails: 7.0.0 - ruby: 3.1.6 - rails: '~> 7.1.0' - + rails: 7.1.0 + name: Ruby ${{ matrix.ruby }} / ActiveRecord ${{ matrix.rails }} services: postgres_primary: @@ -178,3 +178,35 @@ jobs: PG_REPLICA_PORT: 5433 run: bundle exec rspec --format progress + + - name: Upload Coverage Report + uses: actions/upload-artifact@v4 + with: + name: ${{ env.RUN_UNIQUE_ID }}_artifact_${{ matrix.ruby }}_${{ matrix.rails }} + path: coverage/ + include-hidden-files: true + if-no-files-found: error + + coverage_report: + needs: [rspec] + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.3.5 + + - name: Install Dependencies + run: | + gem install bundler + bundle install + + - name: Download Partial Coverage Resultsets + uses: actions/download-artifact@v4 + + - name: Collate Partial Coverage Resultsets + run: bundle exec rake coverate:report diff --git a/Gemfile b/Gemfile index e35704c..a4420e7 100644 --- a/Gemfile +++ b/Gemfile @@ -15,8 +15,8 @@ group :test do end if ENV["RAILS_VERSION"] - gem "activerecord", ENV["RAILS_VERSION"] - gem "activesupport", ENV["RAILS_VERSION"] + gem "activerecord", "~> #{ENV["RAILS_VERSION"]}" + gem "activesupport", "~> #{ENV["RAILS_VERSION"]}" end # Specify your gem's dependencies in active_record_proxy_adapters.gemspec