-
Notifications
You must be signed in to change notification settings - Fork 18
40 lines (35 loc) · 924 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
name: build-and-test
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
GO_VERSION: [ "1.19" ]
steps:
- name: Check out the codebase.
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.GO_VERSION }}
- name: Caching dependency
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
~/go/bin
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Run tests
run: |
go mod download
set -x
go test -covermode atomic -race -timeout 300s -coverprofile ./coverage.out $(go list ./...)
cov="$(go tool cover -func coverage.out | grep -v 100.0% || true)"
echo $cov
test -z "$cov"