Skip to content

Commit

Permalink
Merge pull request #90 from stacklok/coverage
Browse files Browse the repository at this point in the history
Add coverage support
  • Loading branch information
JAORMX authored Feb 15, 2024
2 parents 3e7e6d7 + 8dfc54a commit 6e35c5d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,35 @@ jobs:
name: frizbee
path: bin/frizbee

cover:
name: Coverage
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v4
with:
go-version-file: 'go.mod'

- name: setup task
uses: arduino/setup-task@b91d5d2c96a56797b48ac1e0e89220bf64044611 # v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run coverage
run: task cover

# Using gcov didn't seem to work for the coveralls app, so we convert it to lcov
- name: Try converting to LCOV
run: go run github.com/jandelgado/gcov2lcov@latest -infile=./coverage.out -outfile=./coverage.lcov

- name: Coveralls GitHub Action
uses: coverallsapp/github-action@e5e2507fa218d2031f39816cd7d078ebd1f1a6c6 # v2.2.3

lint:
runs-on: ubuntu-latest
steps:
Expand Down
5 changes: 5 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ tasks:
cmds:
- go test -v ./...

cover:
desc: Run coverage
cmds:
- go test -coverprofile=coverage.out ./...

build:
desc: Build the frizbee binary
cmds:
Expand Down

0 comments on commit 6e35c5d

Please sign in to comment.