Skip to content

Commit

Permalink
chore: Add coverage to GH CI
Browse files Browse the repository at this point in the history
  • Loading branch information
bombsimon committed Feb 5, 2023
1 parent c4aa242 commit 09f5db5
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 09f5db5

Please sign in to comment.