Debian Codegraph @

.github/workflows/test.yaml

raw
1 name: Run tests
2 on:
3 push:
4 branches: [master]
5 pull_request:
6 branches: [master]
7 env:
8 GO111MODULE: on
9 jobs:
10 test:
11 strategy:
12 matrix:
13 go-version: [1.11.x, 1.16.x]
14 os: [ubuntu-latest]
15 runs-on: ${{ matrix.os }}
16 steps:
17
18 - name: Install Go
19 uses: actions/setup-go@v2
20 with:
21 go-version: ${{ matrix.go-version }}
22
23 - name: Checkout code
24 uses: actions/checkout@v2
25
26 # Needed for versions <1.14 tests
27 - name: Install mock
28 run: |
29 GO111MODULE=off go get github.com/golang/mock | true
30
31 - name: Vet and build
32 run: |
33 go vet ./...
34 go build ./...
35
36 - name: Install tools
37 run: |
38 go install github.com/golang/mock/mockgen
39 GO111MODULE=off go get -u golang.org/x/lint/golint
40
41 - name: Run test scripts
42 run: |
43 ./ci/check_go_fmt.sh
44 ./ci/check_go_lint.sh
45 ./ci/check_go_generate.sh
46 ./ci/check_go_mod.sh
47 ./ci/check_panic_handling.sh
48
49 - name: Run Go tests
50 run: |
51 for i in $(find $PWD -name go.mod); do
52 pushd $(dirname $i)
53 go test ./...
54 popd
55 done