-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (39 loc) · 1.01 KB
/
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
45
name: Coverage
on:
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ${{ matrix.os }}
permissions:
contents: write
services:
memcached:
image: memcached:latest
ports:
- 11211:11211
strategy:
matrix:
os: [ ubuntu-latest ]
go: [ 1.21.x ]
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Test
run: |
go test -v -cover ./... -coverprofile coverage.out -coverpkg ./...
go tool cover -func coverage.out -o coverage.out
- name: Go Coverage Badge
uses: tj-actions/coverage-badge-go@v1
if: ${{ runner.os == 'linux' }}
with:
green: 80
filename: coverage.out
- uses: stefanzweifel/git-auto-commit-action@v5
id: auto-commit-action
with:
commit_message: Apply Code Coverage Badge
file_pattern: ./README.md