mirror of
https://github.com/wneessen/apg-go.git
synced 2024-11-21 21:30:51 +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
5
.github/workflows/codecov.yml
vendored
5
.github/workflows/codecov.yml
vendored
|
@ -36,10 +36,7 @@ jobs:
|
||||||
go-version: ${{ matrix.go }}
|
go-version: ${{ matrix.go }}
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: |
|
run: |
|
||||||
go test -v -race --coverprofile=coverage.coverprofile.tmp --covermode=atomic ./...
|
go test -v -race --coverprofile=coverage.coverprofile --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
|
|
||||||
- name: Upload coverage to Codecov
|
- name: Upload coverage to Codecov
|
||||||
if: success() && matrix.go == '1.22' && matrix.os == 'ubuntu-latest'
|
if: success() && matrix.go == '1.22' && matrix.os == 'ubuntu-latest'
|
||||||
uses: codecov/codecov-action@v3
|
uses: codecov/codecov-action@v3
|
||||||
|
|
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