mirror of
https://github.com/wneessen/apg-go.git
synced 2024-12-22 11:10:39 +01:00
Add codecov configuration file and simplify coverage profile generation
A codecov.yml configuration file has been added to specify the coverage target and other codecov settings. The CI pipeline has also been streamlined to directly generate the coverage profile without using grep for filtering ignored code paths. This makes it easier to understand and maintain the testing and coverage reporting process.
This commit is contained in:
parent
aae55baa1d
commit
83c67b33be
2 changed files with 28 additions and 5 deletions
7
.github/workflows/codecov.yml
vendored
7
.github/workflows/codecov.yml
vendored
|
@ -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
|
||||
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
|
||||
|
|
26
codecov.yml
Normal file
26
codecov.yml
Normal file
|
@ -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"
|
Loading…
Reference in a new issue