-
Notifications
You must be signed in to change notification settings - Fork 5
44 lines (38 loc) · 1.05 KB
/
test-coverage.yml
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
33
34
35
36
37
38
39
40
41
42
43
44
name: Test Coverage
run-name: Test Coverage
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Go 1.21
uses: actions/setup-go@v2
with:
go-version: 1.21
- name: Generate Test Coverage
run: go test ./... -coverprofile=./cover.out
- name: Check Test Coverage
id: coverage
uses: vladopajic/go-test-coverage@v2
with:
config: ./.testcoverage.yml
- name: Make Coverage Badge
uses: action-badges/[email protected]
if: contains(github.ref, 'master')
with:
label: coverage
message: ${{ steps.coverage.outputs.badge-text }}
message-color: ${{ steps.coverage.outputs.badge-color }}
file-name: coverage.svg
badge-branch: badges ## orphan branch where badge will be committed
github-token: "${{ secrets.GH_PAT }}"