-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (42 loc) · 1.06 KB
/
test.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
45
46
47
48
name: Run tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main,develop ]
env:
GO111MODULE: on
jobs:
test:
strategy:
matrix:
go-version: [ 1.15.x,1.18.x ]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Vet and build
run: |
go vet ./...
go build ./...
- name: Install mockgen
run: |
go get github.com/golang/mock/[email protected]
# go install github.com/golang/mock/mockgen
- name: Run Go tests all
if: ${{ startsWith(matrix.go-version, '1.18') }}
run: |
for i in $(find $PWD -name go.mod); do
pushd $(dirname $i)
go test ./...
popd
done
- name: Run Go tests some
if: ${{ startsWith(matrix.go-version, '1.18') == false }}
run: |
go test ./...