Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: update coverage ignore list for generated code #3262

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/codecov-ignore-generated.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@
#
# .github/codecov-ignore-generated.sh >> .github/codecov.yml

cat <<EOT
# we measure coverage but don't enforce it
# https://docs.codecov.com/docs/codecov-yaml
coverage:
status:
patch:
default:
target: 0%
project:
default:
target: 0%

# if a directory is ignored, there is no way to un-ignore files like pkg/models/helpers.go
# so we make a full list
ignore:
EOT

find . -name "*.go" | while read -r file; do
if head -n 1 "$file" | grep -q "Code generated by"; then
echo " - \"$file\""
Expand Down
139 changes: 0 additions & 139 deletions .github/codecov.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .github/workflows/bats-sqlite-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ jobs:
run: for file in $(find ./test/local/var/log -type f); do echo ">>>>> $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:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/go-tests-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/go-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@ msi
__pycache__
*.py[cod]
*.egg-info

# automatically generated before running codecov
.github/codecov.yml