-
Notifications
You must be signed in to change notification settings - Fork 177
94 lines (83 loc) · 2.43 KB
/
build-test-lint.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: build-test-lint
on: [push, pull_request]
jobs:
build:
name: build
strategy:
matrix:
go-version: [1.13.x, 1.14.x, 1.15.x, 1.16.x]
goarch: [amd64]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Build
env:
GOARCH: ${{ matrix.goarch }}
GOOS: ${{ matrix.goos }}
run: make build
test:
runs-on: ubuntu-latest
needs: build
name: test
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.16.x
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Install hwdata
run: sudo apt-get install hwdata -y
- name: Go test
run: make test
golangci:
name: Golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.37
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
env:
SHELLCHECK_OPTS: -e SC3037 # disabled because of false issue in entrypoint.sh ln 14-21. Not using any complicated flags. Works with alpines almquist shell.
steps:
- uses: actions/checkout@v2
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
ignore: vendor
hadolint:
runs-on: ubuntu-latest
name: Hadolint
steps:
- uses: actions/checkout@v2
- uses: brpaz/hadolint-action@v1.5.0
name: Run Hadolint
with:
dockerfile: ./images/Dockerfile
ignore: DL3018 # DL3018: GH issue 368
go-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x
# if this fails, run go mod tidy
- name: Check if module files are consistent with code
run: go mod tidy && git diff --exit-code
# if this fails, run go mod vendor
- name: Check if vendor directory is consistent with go modules
run: go mod vendor && git diff --exit-code