-
Notifications
You must be signed in to change notification settings - Fork 4
43 lines (37 loc) · 1013 Bytes
/
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
name: Go Test
on:
push:
branches: [ master, feature/* ]
pull_request:
branches: [ master ]
env:
GOPROXY: "https://proxy.golang.org"
jobs:
test:
name: "go test"
strategy:
matrix:
go-version: [ 1.18.x, 1.19.x, 1.20.x, 1.21.x ]
platform: [ ubuntu-latest ]
runs-on: ${{ matrix.platform }}
services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
ports:
- 6379:6379
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache: true
cache-dependency-path: ./go.sum
- run: go version
- name: Run tests
run: go test ./... -v -covermode=atomic -race -coverprofile=coverage.txt
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3