diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 6bdc0f3..d8d91e4 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -44,3 +44,32 @@ jobs: - name: Test code run: go test -race -v ./... + + coverage: + runs-on: ubuntu-latest + steps: + - name: Install Go + if: success() + uses: actions/setup-go@v3 + with: + go-version: '1.20' + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Calc coverage + run: | + export PATH=$PATH:$(go env GOPATH)/bin + go test -v -covermode=count -coverprofile=coverage.out + + - name: Convert coverage to lcov + uses: jandelgado/gcov2lcov-action@v1.0.9 + with: + infile: coverage.out + outfile: coverage.lcov + + - name: Coveralls + uses: coverallsapp/github-action@1.1.3 + with: + github-token: ${{ secrets.github_token }} + path-to-lcov: coverage.lcov