From 40021b6bcf40cb724c4444c79239223c0419ec71 Mon Sep 17 00:00:00 2001 From: mmetc <92726601+mmetc@users.noreply.github.com> Date: Fri, 4 Oct 2024 13:15:16 +0200 Subject: [PATCH] CI: update coverage ignore list for generated code (#3262) * CI: update coverage ignore list for generated code * CI: generate codecov.yml automatically --- .github/codecov-ignore-generated.sh | 17 +++ .github/codecov.yml | 139 --------------------- .github/workflows/bats-sqlite-coverage.yml | 4 + .github/workflows/go-tests-windows.yml | 4 + .github/workflows/go-tests.yml | 4 + .gitignore | 3 + 6 files changed, 32 insertions(+), 139 deletions(-) delete mode 100644 .github/codecov.yml diff --git a/.github/codecov-ignore-generated.sh b/.github/codecov-ignore-generated.sh index 3c896d47be7..0f59b1de4a0 100755 --- a/.github/codecov-ignore-generated.sh +++ b/.github/codecov-ignore-generated.sh @@ -4,6 +4,23 @@ # # .github/codecov-ignore-generated.sh >> .github/codecov.yml +cat <>>>> $file"; cat $file; echo; done if: ${{ always() }} + - name: Ignore-list of generated files for codecov + run: | + .github/codecov-ignore-generated.sh >> .github/codecov.yml + - name: Upload bats coverage to codecov uses: codecov/codecov-action@v4 with: diff --git a/.github/workflows/go-tests-windows.yml b/.github/workflows/go-tests-windows.yml index a31e42cf702..488756d0059 100644 --- a/.github/workflows/go-tests-windows.yml +++ b/.github/workflows/go-tests-windows.yml @@ -47,6 +47,10 @@ jobs: if(!$?) { cat out.txt | sed 's/ *coverage:.*of statements in.*//' | richgo testfilter; Exit 1 } cat out.txt | sed 's/ *coverage:.*of statements in.*//' | richgo testfilter + - name: Ignore-list of generated files for codecov + run: | + .github/codecov-ignore-generated.sh >> .github/codecov.yml + - name: Upload unit coverage to Codecov uses: codecov/codecov-action@v4 with: diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index a6c72a91af6..52de434ad9b 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -165,6 +165,10 @@ jobs: set -o pipefail make go-acc | sed 's/ *coverage:.*of statements in.*//' | richgo testfilter + - name: Ignore-list of generated files for codecov + run: | + .github/codecov-ignore-generated.sh >> .github/codecov.yml + - name: Upload unit coverage to Codecov uses: codecov/codecov-action@v4 with: diff --git a/.gitignore b/.gitignore index 6e6624fd282..d76efcbfc48 100644 --- a/.gitignore +++ b/.gitignore @@ -60,3 +60,6 @@ msi __pycache__ *.py[cod] *.egg-info + +# automatically generated before running codecov +.github/codecov.yml