diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e3e1a3bd..83ceac2d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -50,6 +50,7 @@ jobs: - name: check test coverage id: coverage uses: vladopajic/go-test-coverage@v2 + continue-on-error: true # Should fail after coverage comment is posted with: config: ./.github/.testcoverage.yml profile: cover.ubuntu-latest.profile,cover.macos-latest.profile @@ -88,4 +89,9 @@ jobs: ``` ${{ fromJSON(steps.coverage.outputs.report) }} ``` - edit-mode: replace \ No newline at end of file + edit-mode: replace + + - name: "finally check coverage" + if: steps.coverage.outcome == 'failure' + shell: bash + run: echo "coverage check failed" && exit 1 \ No newline at end of file diff --git a/docs/github_action.md b/docs/github_action.md index 3a053384..6b9b7663 100644 --- a/docs/github_action.md +++ b/docs/github_action.md @@ -48,6 +48,7 @@ Here is an example of how to post comments with the coverage report to your pull - name: check test coverage id: coverage uses: vladopajic/go-test-coverage@v2 + continue-on-error: true # Should fail after coverage comment is posted with: config: ./.github/.testcoverage.yml @@ -84,4 +85,9 @@ Here is an example of how to post comments with the coverage report to your pull ${{ fromJSON(steps.coverage.outputs.report) }} ``` edit-mode: replace + + - name: "finally check coverage" + if: steps.coverage.outcome == 'failure' + shell: bash + run: echo "coverage check failed" && exit 1 ``` \ No newline at end of file