forked from cilium/cilium
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (89 loc) · 2.72 KB
/
go-check.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
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
name: Go-related checks
on:
pull_request: {}
push:
branches:
- master
jobs:
go-mod:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: 1.14.7
- name: Checkout code
uses: actions/checkout@v2
- name: Check module vendoring
run: |
go mod tidy
go mod vendor
git diff --exit-code
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v1.2.1
with:
version: v1.27
precheck:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: 1.14.7
- name: Checkout code
uses: actions/checkout@v2
with:
# hard-code the path instead of using ${{ github.repository }} to make sure it works for forked repo as well
path: src/github.com/cilium/cilium
- name: Go code prechecks
run: |
cd src/github.com/cilium/cilium
make precheck
generate-api:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: 1.14.7
- name: Checkout code
uses: actions/checkout@v2
with:
# hard-code the path instead of using ${{ github.repository }} to make sure it works for forked repo as well
path: src/github.com/cilium/cilium
- name: Check api generated files
run: |
cd src/github.com/cilium/cilium
contrib/scripts/check-api-code-gen.sh
generate-k8s-api:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: 1.14.7
- name: Checkout code
uses: actions/checkout@v2
with:
# hard-code the path instead of using ${{ github.repository }} to make sure it works for forked repo as well
path: src/github.com/cilium/cilium
- name: Install protobuf dependencies
env:
PROTOBUF_VERSION: 3.12.4
run: |
curl -Lo protoc-$PROTOBUF_VERSION-linux-x86_64.zip https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-linux-x86_64.zip
unzip protoc-$PROTOBUF_VERSION-linux-x86_64.zip
sudo chmod +x bin/protoc && sudo cp bin/protoc /usr/local/bin
- name: Set GOPATH
run: |
echo "##[set-env name=GOPATH;]$GITHUB_WORKSPACE"
shell: bash
- name: Check k8s generated files
run: |
cd src/github.com/cilium/cilium
contrib/scripts/check-k8s-code-gen.sh