generated from meshery/meshery-istio
-
Notifications
You must be signed in to change notification settings - Fork 33
114 lines (111 loc) · 3.21 KB
/
ci.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Default Meshery-App Mesh Workflow
on:
push:
branches:
- "*"
tags:
- "v*"
pull_request:
branches:
- master
jobs:
lint:
name: Check & Review code
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
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.49
# Optional: working directory, useful for monorepos
# working-directory: somedir
# Optional: golangci-lint command line arguments.
# args: --issues-exit-code=0
# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true
error_check:
name: Error check
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@master
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@master
with:
go-version: 1.19
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go get -u github.com/kisielk/errcheck; /home/runner/go/bin/errcheck -tags draft ./...
static_check:
name: Static check
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- uses: dominikh/[email protected]
with:
install-go: false
version: "2022.1"
vet:
name: Vet
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@master
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@master
with:
go-version: 1.19
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go vet -tags draft ./...
sec_check:
name: Security check
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- name: Check out code
uses: actions/checkout@master
with:
fetch-depth: 1
- name: Run Gosec Security Scanner
uses: securego/gosec@master
with:
args: -exclude=G301,G304,G107,G101,G110,G204,G409,G305,G302 ./...
tests:
# needs: [lint, error_check, static_check, vet, sec_check]
name: Tests
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@master
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@master
with:
go-version: 1.19
- name: Create cluster using KinD
uses: engineerd/[email protected]
with:
version: "v0.11.0"
- run: |
export CURRENTCONTEXT="$(kubectl config current-context)"
echo "current-context:" ${CURRENTCONTEXT}
export KUBECONFIG="${HOME}/.kube/config"
echo "environment-kubeconfig:" ${KUBECONFIG}
GOPROXY=direct GOSUMDB=off GO111MODULE=on go test ./...