Skip to content

Commit

Permalink
CI: generate codecov.yml before tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc committed Oct 9, 2024
1 parent b9bccfa commit 20a7042
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Run this from the repository root:
#
# .github/codecov-ignore-generated.sh >> .github/codecov.yml
# .github/generate-codecov-yml.sh >> .github/codecov.yml

cat <<EOT
# we measure coverage but don't enforce it
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/bats-sqlite-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ jobs:
run: |
make clean bats-build bats-fixture BUILD_STATIC=1
- name: Generate codecov configuration
run: |
.github/generate-codecov-yml.sh >> .github/codecov.yml
- name: "Run tests"
run: ./test/run-tests ./test/bats --formatter $(pwd)/test/lib/color-formatter

Expand Down Expand Up @@ -79,10 +83,6 @@ 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
8 changes: 4 additions & 4 deletions .github/workflows/go-tests-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ jobs:
run: |
make build BUILD_RE2_WASM=1
- name: Generate codecov configuration
run: |
.github/generate-codecov-yml.sh >> .github/codecov.yml
- name: Run tests
run: |
go install github.com/kyoh86/richgo@v0.3.10
go test -tags expr_debug -coverprofile coverage.out -covermode=atomic ./... > out.txt
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
8 changes: 6 additions & 2 deletions .github/workflows/go-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ jobs:
aws --endpoint-url=http://127.0.0.1:4566 --region us-east-1 kinesis create-stream --stream-name stream-1-shard --shard-count 1
aws --endpoint-url=http://127.0.0.1:4566 --region us-east-1 kinesis create-stream --stream-name stream-2-shards --shard-count 2
- name: Generate codecov configuration
run: |
.github/generate-codecov-yml.sh >> .github/codecov.yml
- name: Build and run tests, static
run: |
sudo apt -qq -y -o=Dpkg::Use-Pty=0 install build-essential libre2-dev
Expand All @@ -165,9 +169,9 @@ jobs:
set -o pipefail
make go-acc | sed 's/ *coverage:.*of statements in.*//' | richgo testfilter
- name: Ignore-list of generated files for codecov
- name: Generate codecov configuration
run: |
.github/codecov-ignore-generated.sh >> .github/codecov.yml
.github/generate-codecov-yml.sh >> .github/codecov.yml
- name: Upload unit coverage to Codecov
uses: codecov/codecov-action@v4
Expand Down

0 comments on commit 20a7042

Please sign in to comment.