From 5eefd8d9deefccf3660f1f0872259bde55155879 Mon Sep 17 00:00:00 2001 From: Andrew Pepler Date: Mon, 15 Jul 2024 16:39:27 +0100 Subject: [PATCH] Store and download artifacts --- .github/workflows/test.yml | 28 +++++++++++++++++++++++++--- lib/tasks/coverage_report.rake | 2 +- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cdc242c154..6ba94c452e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -101,10 +101,32 @@ jobs: bundle exec rake parallel:setup[4] bundle exec parallel_rspec -n "${CI_TOTAL_JOBS}" --only-group "${CI_JOB_INDEX}" --group-by "runtime" - - name: collate coverage + - name: Upload coverage + uses: actions/upload-artifact@v4 + with: + name: "coverage-${CI_JOB_INDEX}" + path: "coverage/.resultset.json" + + coverage: + needs: test + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Ruby and install gems + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + + - name: Download coverage + uses: actions/download-artifact@v4 + + - name: Collate coverage run: bundle exec rake coverage:report - - name: Code coverage + - name: Code coverage result uses: joshmfrankel/simplecov-check-action@main with: github_token: ${{ secrets.GITHUB_TOKEN }} @@ -113,6 +135,6 @@ jobs: build-and-deploy: if: ${{ github.ref == 'refs/heads/main' }} - needs: test + needs: coverage uses: ./.github/workflows/deploy.yml secrets: inherit diff --git a/lib/tasks/coverage_report.rake b/lib/tasks/coverage_report.rake index 2f4a4388ec..4e54ee401d 100644 --- a/lib/tasks/coverage_report.rake +++ b/lib/tasks/coverage_report.rake @@ -3,6 +3,6 @@ namespace :coverage do task report: :environment do require "simplecov" - SimpleCov.collate Dir["coverage/.resultset.json"] + SimpleCov.collate Dir["coverage*"] end end