Skip to content

Commit 36c86d0

Browse files
committed
Add codecov to ci
1 parent f3cd444 commit 36c86d0

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/coverage.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Go
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
services:
16+
redis:
17+
image: redis/redis-stack-server:edge
18+
options: >-
19+
--health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
20+
ports:
21+
- 6379:6379
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v2
26+
27+
- name: Set up Go
28+
uses: actions/setup-go@v2
29+
with:
30+
go-version: 1.21
31+
32+
- name: Install dependencies
33+
run: go mod tidy
34+
35+
- name: Run tests
36+
run: go test -coverprofile=coverage.out ./...
37+
38+
- name: Upload to Codecov
39+
uses: codecov/codecov-action@v4
40+
with:
41+
files: coverage.out
42+
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)