File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88
99 steps :
1010 - uses : actions/checkout@v4
11+ with :
12+ ref : ${{ github.head_ref }}
1113 - name : Setup Go
1214 uses : actions/setup-go@v5
1315 with :
1719 - name : Build
1820 run : go build -v ./...
1921 - name : Test with the Go CLI
20- run : go test
22+ run : |
23+ go test -v ./... -covermode=count -coverprofile=coverage.out
24+ go tool cover -func=coverage.out -o=coverage.out
25+ - name : Go Coverage Badge # Pass the `coverage.out` output to this action
26+ uses : tj-actions/coverage-badge-go@v2
27+ with :
28+ filename : coverage.out
29+ - name : Verify Changed files
30+ uses : tj-actions/verify-changed-files@v16
31+ id : verify-changed-files
32+ with :
33+ files : README.md
34+ - name : Commit and push changes
35+ if : steps.verify-changed-files.outputs.files_changed == 'true'
36+ run : |
37+ git config --local user.email "action@github.com"
38+ git config --local user.name "GitHub Action"
39+ git add README.md
40+ git commit -m "chore: Updated coverage badge."
41+ git push
2142
Original file line number Diff line number Diff line change 11# RingChan
22
33[ ![ CI] ( https://github.com/floatdrop/ringchan/actions/workflows/ci.yaml/badge.svg )] ( https://github.com/floatdrop/ringchan/actions/workflows/ci.yaml )
4+ ![ Coverage] ( https://img.shields.io/badge/Coverage-90.9%25-brightgreen )
45[ ![ Go Report Card] ( https://goreportcard.com/badge/github.com/floatdrop/ringchan )] ( https://goreportcard.com/report/github.com/floatdrop/ringchan )
56[ ![ Go Reference] ( https://pkg.go.dev/badge/github.com/floatdrop/ringchan.svg )] ( https://pkg.go.dev/github.com/floatdrop/ringchan )
67[ ![ License: MIT] ( https://img.shields.io/badge/License-MIT-yellow.svg )] ( https://opensource.org/licenses/MIT )
You can’t perform that action at this time.
0 commit comments