-
Notifications
You must be signed in to change notification settings - Fork 3
32 lines (32 loc) · 1.05 KB
/
coverage.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: coverage
on:
push:
branches:
- main
permissions: {}
jobs:
coverage:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version: stable
- run: |
git config --global user.email "[email protected]"
git config --global user.name "Test"
- 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@f080863892c102695c8066abc08aae12e3e94e1b # v2.13.1
with:
profile: cover.out
local-prefix: github.com/${{ github.repository }}
git-token: ${{ secrets.GITHUB_TOKEN }}
# orphan branch for storing badges
git-branch: badges