-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (37 loc) · 1.08 KB
/
go.yaml
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
name: Go
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install go
uses: actions/setup-go@v1
with:
go-version: 1.21
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.54.1
skip-go-installation: true
- name: Run tests and extract coverage
run: |
go test -timeout=60s -covermode=count -coverprofile=$GITHUB_WORKSPACE/profile.cov_tmp ./...
cat $GITHUB_WORKSPACE/profile.cov_tmp | grep -v "mock_" > $GITHUB_WORKSPACE/profile.cov
env:
CGO_ENABLED: 0
- name: Submit coverage to codecov
run: |
cat $GITHUB_WORKSPACE/profile.cov > $GITHUB_WORKSPACE/coverage.txt
cd $GITHUB_WORKSPACE
bash <(curl -s https://codecov.io/bash)
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
GOFLAGS: "-mod=mod"
CGO_ENABLED: 0