Skip to content

Commit

Permalink
add codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
deatil committed Jan 29, 2024
1 parent 77982f1 commit 075d128
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21

- name: Unit tests
run: go test -coverprofile=cover.out ./...

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: cover.out
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<p align="center">
<a href="https://pkg.go.dev/github.com/deatil/go-datebin"><img src="https://pkg.go.dev/badge/deatil/go-datebin.svg" alt="Go Reference"></a>
<a href="https://codecov.io/gh/deatil/go-datebin" >
<img src="https://codecov.io/gh/deatil/go-datebin/graph/badge.svg"/>
<img src="https://codecov.io/gh/deatil/go-datebin/graph/badge.svg?token=SS2Z1IY0XL"/>
</a>
<img src="https://goreportcard.com/badge/github.com/deatil/go-datebin" />
<a href="https://github.com/avelino/awesome-go"><img src="https://awesome.re/mentioned-badge.svg" alt="Mentioned in Awesome Go"></a>
Expand Down
2 changes: 1 addition & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<p align="center">
<a href="https://pkg.go.dev/github.com/deatil/go-datebin"><img src="https://pkg.go.dev/badge/deatil/go-datebin.svg" alt="Go Reference"></a>
<a href="https://codecov.io/gh/deatil/go-datebin" >
<img src="https://codecov.io/gh/deatil/go-datebin/graph/badge.svg"/>
<img src="https://codecov.io/gh/deatil/go-datebin/graph/badge.svg?token=SS2Z1IY0XL"/>
</a>
<img src="https://goreportcard.com/badge/github.com/deatil/go-datebin" />
<a href="https://github.com/avelino/awesome-go"><img src="https://awesome.re/mentioned-badge.svg" alt="Mentioned in Awesome Go"></a>
Expand Down

0 comments on commit 075d128

Please sign in to comment.