diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 0ea7337..81020b6 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -36,12 +36,9 @@ jobs: go-version: ${{ matrix.go }} - name: Run Tests run: | - go test -v -race --coverprofile=coverage.coverprofile.tmp --covermode=atomic ./... - - name: Remove ignored code from coverage profile - run: | - grep -v -E '(apg-go/cmd/apg/apg.go|apg-go/example-code)' coverage.coverprofile.tmp > coverage.coverprofile + go test -v -race --coverprofile=coverage.coverprofile --covermode=atomic ./... - name: Upload coverage to Codecov if: success() && matrix.go == '1.22' && matrix.os == 'ubuntu-latest' uses: codecov/codecov-action@v3 with: - token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos \ No newline at end of file + token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..5a395e4 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,26 @@ +# SPDX-FileCopyrightText: 2022-2023 The go-mail Authors +# +# SPDX-License-Identifier: CC0-1.0 + +coverage: + status: + project: + default: + target: 85% + threshold: 5% + base: auto + if_ci_failed: error + only_pulls: false + patch: + default: + target: 80% + base: auto + if_ci_failed: error + threshold: 5% + +comment: + require_changes: true + +ignore: + - "cmd/apg" + - "example-code"