From f465b1cc893523a7d5b30dfe1cf1a80de2909ca4 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Fri, 13 Oct 2023 21:51:46 +0200 Subject: [PATCH] feat(tests): add code coverage reporting --- .github/workflows/continuous-integration.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 4510d3309..289c4b2cc 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -119,5 +119,20 @@ jobs: env: RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} run: | + mkdir coverage docker run -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_HOST=localhost -e \ - RAILS_MASTER_KEY --network=host app bin/ci.sh spec + RAILS_MASTER_KEY --network=host -v "$(pwd)"'/coverage:/opt/app/coverage' app bin/ci.sh spec + + - name: Upload coverage report to Codecov + if: ${{ !cancelled() }} + uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true + + - name: Upload coverage report artifact + if: ${{ !cancelled() }} + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 + with: + name: coverage + path: coverage/