-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (69 loc) · 3.02 KB
/
go.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23'
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...
- name: Go Coverage
# You may pin to the exact commit or the version.
# uses: gwatts/go-coverage-action@2845595538a59d63d1bf55f109c14e104c6f7cb3
uses: gwatts/[email protected]
id: coverage
with:
# github token
#token: # optional, default is ${{ github.token }}
# URL of final uploaded report. e.g. https://reports.example.com/{{ $github.sha }}/cover.html
#report-url: # optional
# Working directory. Defaults to project root
#working-directory: # optional, default is
# File or pathname for the resulting html coverage report
#report-filename: # optional, default is go-coverage.html
# Parameter to pass to go tests -covermode argument. Either count, set or atomic
#cover-mode: # optional, default is count
# Parameter to pass to go tests -coverpkg argument. Leave empty to omit flag
cover-pkg: . # optional, default is
# Additional build arguments to pass to go test
#test-args: # optional, default is []
# Package names to test, passed to go test - Multiple arguments should be separated by newlines
test-pkgs: . # optional, default is ./...
# Fail the build if the coverage drops below supplied percentage
#coverage-threshold: # optional, default is 0
# Fail the build if coverage drops below coverage-threshold. One of "always", "never" or "only_pull_requests"
#fail-coverage: # optional, default is only_pull_requests
# Adds a comment to the PR with coverage information if true. If false will only add an action summary report
#add-comment: # optional, default is true
# One or more regular expressions matching filenames to exclude from coverage statistics (e.g. for generated Go files)
#ignore-pattern: |
# 'example/.*'
# The refname to use for the git notes. Defaults to gocoverage
#notes-ref: # optional, default is gocoverage
- name: Update coverage badge
uses: schneegans/[email protected]
if: github.ref_name == 'main'
with:
auth: ${{ secrets.COVERAGE_GIST_SECRET }}
gistID: b272dbf4526c9be75f7da96352873a71
filename: gsheets-parser-coverage.json
style: flat
namedLogo: Go
label: Coverage
labelColor: rgb(45, 49, 54)
message: ${{ steps.coverage.outputs.coverage-pct-1dp }}%
valColorRange: ${{ steps.coverage.outputs.coverage-pct-1dp }}
maxColorRange: 100
minColorRange: 0