Skip to content

Merge pull request #400 from uselagoon/dependabot/github_actions/soft… #3

Merge pull request #400 from uselagoon/dependabot/github_actions/soft…

Merge pull request #400 from uselagoon/dependabot/github_actions/soft… #3

Workflow file for this run

name: coverage
on:
push:
branches:
- main
permissions: {}
jobs:
coverage:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: stable
- name: Calculate coverage
run: |
go test -v -covermode=atomic -coverprofile=cover.out.raw -coverpkg=./... ./...
# remove generated code from coverage calculation
grep -Ev 'internal/mock|_enumer.go' cover.out.raw > cover.out
- name: Generage coverage badge
uses: vladopajic/go-test-coverage@1079cd4e58dda229c04ffdb6324fc3756b8542ff # v2.10.1
with:
profile: cover.out
local-prefix: github.com/${{ github.repository }}
git-token: ${{ secrets.GITHUB_TOKEN }}
# orphan branch for storing badges
git-branch: badges