Skip to content

Commit

Permalink
Run test coverage checks in unit-tests workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Beal committed May 2, 2024
1 parent c033493 commit 0485d55
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,31 @@ jobs:
- name: Check style
run: make check_style

- name: Install Go Test Coverage
run: make install-go-test-coverage

- name: Build
run: make bin

- name: Test
run: make test

- name: Check test coverage
uses: vladopajic/go-test-coverage@v2
id: go-test-coverage
with:
config: ./.testcoverage.yml

- name: Comment test coverage
if: ${{ github.event_name == 'pull_request' }}
uses: actions/github-script@v7
env:
TOTAL_COVERAGE: ${{ steps.go-test-coverage.outputs.total-coverage }}
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Total test coverage: ${{ env.TOTAL_COVERAGE }}%'
})

0 comments on commit 0485d55

Please sign in to comment.