-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (46 loc) · 1.5 KB
/
go-tests.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
49
50
51
52
53
54
55
56
57
58
---
name: 'Run Go Tests'
on:
push:
pull_request:
workflow_dispatch:
env:
GO_VERSION: 1.19.4
GO_WORKING_DIRECTORY: '.'
TEST_FILE: mockgcp_test.go
jobs:
go-tests:
runs-on: ubuntu-latest
permissions: # Must change the job token permissions to use JWT auth
contents: read
id-token: write
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a
with:
go-version: ${{ env.GO_VERSION }}
- name: Verify dependencies
working-directory: ${{ env.GO_WORKING_DIRECTORY }}
run: go mod verify
- name: Build
working-directory: ${{ env.GO_WORKING_DIRECTORY }}
run: go build -v ./...
- name: Run go vet
working-directory: ${{ env.GO_WORKING_DIRECTORY }}
run: go vet ./...
- name: Install staticcheck
working-directory: ${{ env.GO_WORKING_DIRECTORY }}
run: go install honnef.co/go/tools/cmd/staticcheck@latest
- name: Run staticcheck
working-directory: ${{ env.GO_WORKING_DIRECTORY }}
run: staticcheck ./...
- name: Install golint
working-directory: ${{ env.GO_WORKING_DIRECTORY }}
run: go install golang.org/x/lint/golint@latest
- name: Run golint
working-directory: ${{ env.GO_WORKING_DIRECTORY }}
run: golint ./...
- name: Run tests
working-directory: ${{ env.GO_WORKING_DIRECTORY }}
run: go test -race -vet=off -v ./...