Skip to content

Commit

Permalink
ci: add coverage report
Browse files Browse the repository at this point in the history
  • Loading branch information
t2y committed Apr 22, 2024
1 parent bed4a83 commit 271630d
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,32 @@ jobs:
- name: Display Go version
run: go version

# install and tests
- name: Install dependencies
run: go mod download

- name: Build
run: go build -v ./...

- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest

- name: Test
run: make test

# coverage
- name: Go Coverage Badge
uses: tj-actions/coverage-badge-go@v1
with:
green: 80
filename: coverage.out
- uses: stefanzweifel/git-auto-commit-action@v4
id: auto-commit-action
with:
commit_message: Apply Code Coverage Badge
skip_fetch: true
skip_checkout: true
file_pattern: ./README.md
- name: Push Changes
if: steps.auto-commit-action.outputs.changes_detected == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ github.token }}
branch: ${{ github.ref }}

0 comments on commit 271630d

Please sign in to comment.