mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 20:36:12 +02:00
CI: generate codecov.yml before tests (#3280)
This commit is contained in:
parent
b9bccfa56f
commit
4ea0537d0b
4 changed files with 15 additions and 11 deletions
|
@ -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
|
8
.github/workflows/bats-sqlite-coverage.yml
vendored
8
.github/workflows/bats-sqlite-coverage.yml
vendored
|
@ -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
|
||||
|
||||
|
@ -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:
|
||||
|
|
8
.github/workflows/go-tests-windows.yml
vendored
8
.github/workflows/go-tests-windows.yml
vendored
|
@ -40,6 +40,10 @@ 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
|
||||
|
@ -47,10 +51,6 @@ 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:
|
||||
|
|
8
.github/workflows/go-tests.yml
vendored
8
.github/workflows/go-tests.yml
vendored
|
@ -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
|
||||
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue