-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (35 loc) · 928 Bytes
/
go-coverage.yml
File metadata and controls
42 lines (35 loc) · 928 Bytes
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
name: Coverage
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: '0'
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: 1.24
cache: 'true'
- name: Build
run: go install
- name: Test
run: |
go test -v -cover ./... -coverprofile coverage.out -coverpkg ./...
go tool cover -func coverage.out -o coverage.out # Replaces coverage.out with the analysis of coverage.out
- name: Go Coverage Badge
uses: tj-actions/coverage-badge-go@v3
with:
green: 80
filename: coverage.out
- uses: stefanzweifel/git-auto-commit-action@v6
id: auto-commit-action
with:
commit_message: Apply Code Coverage Badge
file_pattern: ./README.md