-
Notifications
You must be signed in to change notification settings - Fork 66
77 lines (67 loc) · 2.94 KB
/
static-scan.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
name: Go-static-analysis
on: [push, pull_request]
jobs:
golangci:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: 1.20.1
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v3.5.3
- name: remove deployer container from dockerfile
run: sed -ie '/End of builder/,+5d' ./docker/userspacecni/Dockerfile
- name: Build the Docker image
run: docker build . -f ./docker/userspacecni/Dockerfile -t userspacecni:latest
- name: run container
run: docker run --name userspacecni -itd userspacecni:latest bash
- name: docker copy generated bin api files
run: docker cp userspacecni:/root/userspace-cni-network-plugin/cnivpp ./
- name: golangci-lint
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
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.52.2
args: --timeout=20m
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v3.5.3
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # master
hadolint:
runs-on: ubuntu-latest
name: Hadolint
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- uses: hadolint/[email protected]
name: Run Hadolint
with:
dockerfile: ./docker/userspacecni/Dockerfile
ignore: DL3008,DL3059
go-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v3.5.2
- name: remove deployer container from dockerfile
run: sed -ie '/End of builder/,+5d' ./docker/userspacecni/Dockerfile
- name: Build the Docker image
run: docker build . -f ./docker/userspacecni/Dockerfile -t userspacecni:latest
- name: run container
run: docker run --name userspacecni -itd userspacecni:latest bash
- name: docker copy generated bin api files
run: docker cp userspacecni:/root/userspace-cni-network-plugin/cnivpp ./
- name: Set up Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: 1.20.1
- name: checkout dockerfile to avoid false diff
run: git checkout ./docker/userspacecni/Dockerfile
# if this fails, run go mod tidy
- name: Check if module files are consistent with code
run: go mod tidy && go get go.fd.io/govpp/binapigen/[email protected] && git diff --exit-code #need package for bin api but not working with tidy
# 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