diff --git a/.github/workflows/ci-go-test-windows.yml b/.github/workflows/ci-go-test-windows.yml index 126e03037..91cb2ea83 100644 --- a/.github/workflows/ci-go-test-windows.yml +++ b/.github/workflows/ci-go-test-windows.yml @@ -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 ./... diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 43bd30de0..3ccc30583 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -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.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 diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index 9a56b7cc8..c5d9be91f 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -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: |