Skip to content

Commit 00234f8

Browse files
committed
test: add test coverage
1 parent aa102b1 commit 00234f8

File tree

4 files changed

+951
-10
lines changed

4 files changed

+951
-10
lines changed

.github/workflows/build_and_test.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ jobs:
2121
- name: install go
2222
uses: actions/setup-go@v5
2323
with:
24-
go-version: ${{ matrix.go }}
24+
go-version: '${{ matrix.go }}'
25+
check-latest: true
2526

2627
- name: checkout code
2728
uses: actions/checkout@v4
@@ -30,8 +31,6 @@ jobs:
3031
run: make build
3132

3233
- name: Test
33-
env:
34-
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
3534
run: |
3635
make cover
3736
@@ -43,10 +42,9 @@ jobs:
4342
parallel: true
4443

4544
- name: Upload coverage
46-
if: (matrix.go == '1.23')
4745
uses: actions/upload-artifact@v4
4846
with:
49-
name: coverage
47+
name: coverage.${{ matrix.go }}
5048
path: coverage.*
5149

5250
- name: Assert no changes

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
/bin
1717
/coverage
1818
vendor/
19-
coverage.out
20-
coverage.html
19+
coverage.*
2120

2221
dist/
23-
.idea/
22+
.idea/
23+
.DS_Store

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ COVERAGEDIR= coverage
1010
SERVICE=local
1111

1212
ifdef GITHUB_ACTIONS
13-
SERVICE=github-actions
13+
SERVICE=github
1414
endif
1515

1616
DATE := $(shell date -u '+%FT%T%z')
@@ -53,7 +53,8 @@ test: gen-test generate
5353
$(GO) test -v -race -shuffle on --tags=example ./example
5454

5555
cover: gen-test test
56-
$(GO) tool cover -html=coverage.out -o coverage.html
56+
grep -v 'main.go' coverage.out > coverage.cov
57+
$(GO) tool cover -html=coverage.cov -o coverage.html
5758

5859
tc: test cover
5960
coveralls: $(GOVERALLS)

0 commit comments

Comments
 (0)