-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (35 loc) · 891 Bytes
/
test.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
name: test
on:
push:
branches: [main]
jobs:
run:
runs-on: ubuntu-latest
strategy:
fail-fast: true
services:
redis:
image: redis:7-alpine
ports:
- 6379:6379
steps:
- name: checkout code
uses: actions/checkout@v2
- name: install go
uses: actions/setup-go@v2
with:
go-version: 1.19
- name: go format
run: gofmt -s -w . && git diff --exit-code
- name: go tidy
run: go mod tidy && git diff --exit-code
- name: go mod
run: go mod download
- name: go test
run: go test -v -race -timeout=60s -shuffle=on -coverprofile=profile.cov ./...
- name: submit coverage
uses: codecov/codecov-action@v2
with:
token: ${{secrets.CODECOV_TOKEN}}
file: profile.cov
fail_ci_if_error: false