fix coverage report (#1553)
This commit is contained in:
parent
357899b83e
commit
f1cfcfe7cc
2
.github/workflows/ci-go-test-windows.yml
vendored
2
.github/workflows/ci-go-test-windows.yml
vendored
|
@ -28,6 +28,6 @@ jobs:
|
|||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
- name: Build
|
||||
run: make build && go get -u github.com/jandelgado/gcov2lcov
|
||||
run: make build
|
||||
- name: All tests
|
||||
run: go test -coverprofile coverage.out -covermode=atomic ./...
|
||||
|
|
22
.github/workflows/ci_tests.yml
vendored
22
.github/workflows/ci_tests.yml
vendored
|
@ -66,14 +66,11 @@ jobs:
|
|||
name: Coverage
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up Go 1.17
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.17
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 1
|
||||
path: go/src/github.com/crowdsecurity/crowdsec
|
||||
|
||||
- name: Download unit report
|
||||
uses: actions/download-artifact@v3
|
||||
|
@ -85,19 +82,30 @@ jobs:
|
|||
with:
|
||||
name: coverage-bats.out.bz2
|
||||
|
||||
# - name: Environment
|
||||
# run: env | sort
|
||||
|
||||
- name: merge coverage reports
|
||||
run: |
|
||||
go get -u github.com/wadey/gocovmerge
|
||||
go install github.com/wadey/gocovmerge@latest
|
||||
bunzip2 coverage.out.bz2
|
||||
bunzip2 coverage-bats.out.bz2
|
||||
~/go/bin/gocovmerge coverage.out coverage-bats.out > coverage-all.out
|
||||
bzip2 <coverage-all.out >coverage-all.out.bz2
|
||||
|
||||
# - name: coverage.out
|
||||
# run: cat coverage.out
|
||||
|
||||
# - name: coverage-bats.out
|
||||
# run: cat coverage-bats.out
|
||||
|
||||
- name: gcov2lcov
|
||||
uses: jandelgado/gcov2lcov-action@v1.0.8
|
||||
with:
|
||||
infile: coverage-all.out
|
||||
outfile: coverage-all.txt
|
||||
env:
|
||||
GOPATH: /home/runner/work/crowdsec/crowdsec/go
|
||||
|
||||
- name: Coverage report artifact (merged)
|
||||
uses: actions/upload-artifact@v2
|
||||
|
|
2
.github/workflows/go-tests.yml
vendored
2
.github/workflows/go-tests.yml
vendored
|
@ -58,7 +58,7 @@ jobs:
|
|||
submodules: false
|
||||
|
||||
- name: Build
|
||||
run: make build && go get -u github.com/jandelgado/gcov2lcov && go get -u github.com/ory/go-acc
|
||||
run: make build && go get -u github.com/ory/go-acc
|
||||
|
||||
- name: "Run tests"
|
||||
run: |
|
||||
|
|
Loading…
Reference in a new issue