From 01c33990374ca651c6bbaeefd7ef1eacd3e3a1ec Mon Sep 17 00:00:00 2001 From: Jon Hadfield Date: Sat, 6 Jan 2024 19:52:18 +0000 Subject: [PATCH] upload coverage for linux/macos. --- .github/workflows/tests.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4fe3053..869dca8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -30,7 +30,31 @@ jobs: name: Tests run: | go mod tidy - go test -cover -v -failfast -p 1 $(go list ./...) + go get github.com/axw/gocov/gocov + go get github.com/AlekSi/gocov-xml + go install github.com/axw/gocov/gocov + go install github.com/AlekSi/gocov-xml + go test -cover -v -failfast -p 1 $(go list ./...) -coverprofile cover.out + gocov convert cover.out | gocov-xml > coverage.xml + if: runner.os != 'Windows' + env: + SN_SERVER: ${{ secrets.SN_SERVER }} + SN_EMAIL: ${{ secrets.SN_EMAIL }} + SN_PASSWORD: ${{ secrets.SN_PASSWORD }} + - + name: Codacy Coverage Reporter + uses: codacy/codacy-coverage-reporter-action@v1.3.0 + with: + coverage-reports: coverage.xml + if: runner.os != 'Windows' + env: + CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} + - + name: Windows Tests + run: | + go mod tidy + go test -v -failfast -p 1 $(go list ./...) + if: runner.os != 'Windows' env: SN_SERVER: ${{ secrets.SN_SERVER }} SN_EMAIL: ${{ secrets.SN_EMAIL }}