11---
22name : test
33
4- on : ["push", "pull_request"]
4+ on :
5+ pull_request : {}
56
67env :
7- GO_VERSION : " 1.22"
8- LINUX_ARCHES : " amd64 386 arm arm64 s390x mips64le ppc64le"
8+ LINUX_ARCHES : " amd64 386 arm arm64 s390x mips64le ppc64le riscv64"
99
1010jobs :
11+ lint :
12+ name : Lint
13+ runs-on : ubuntu-latest
14+ steps :
15+ - uses : actions/checkout@v4
16+ - name : setup go
17+ uses : actions/setup-go@v5
18+ with :
19+ go-version-file : .github/go-version
20+ - uses : ibiqlik/action-yamllint@v3
21+ with :
22+ format : auto
23+ - uses : golangci/golangci-lint-action@v6
24+ with :
25+ version : v1.61.0
26+ args : -v
27+ verify-vendor :
28+ name : Verify vendor directory
29+ runs-on : ubuntu-latest
30+ steps :
31+ - uses : actions/checkout@v4
32+ - name : Install Go
33+ uses : actions/setup-go@v5
34+ with :
35+ go-version-file : .github/go-version
36+ - name : Check module vendoring
37+ run : |
38+ go mod tidy
39+ go mod vendor
40+ test -z "$(git status --porcelain)" || (echo "please run 'go mod tidy && go mod vendor', and submit your changes"; exit 1)
1141 build :
1242 name : Build all linux architectures
43+ needs : lint
1344 runs-on : ubuntu-latest
1445 steps :
46+ - uses : actions/checkout@v4
1547 - name : setup go
16- uses : actions/setup-go@v2
48+ uses : actions/setup-go@v5
1749 with :
18- go-version : ${{ env.GO_VERSION }}
19- - uses : actions/checkout@v2
20-
50+ go-version-file : .github/go-version
2151 - name : Build on all supported architectures
2252 run : |
2353 set -e
2656 GOARCH=$arch ./build_linux.sh
2757 rm bin/*
2858 done
29-
3059 test-linux :
3160 name : Run tests on Linux amd64
61+ needs : build
3262 runs-on : ubuntu-latest
3363 steps :
3464 - name : Install kernel module
@@ -37,22 +67,25 @@ jobs:
3767 sudo apt-get install linux-modules-extra-$(uname -r)
3868 - name : Install nftables
3969 run : sudo apt-get install nftables
40-
70+ - name : Install dnsmasq(dhcp server)
71+ run : |
72+ sudo apt-get install dnsmasq
73+ sudo systemctl disable --now dnsmasq
74+ - uses : actions/checkout@v4
4175 - name : setup go
42- uses : actions/setup-go@v2
76+ uses : actions/setup-go@v5
4377 with :
44- go-version : ${{ env.GO_VERSION }}
78+ go-version-file : .github/go-version
4579 - name : Set up Go for root
4680 run : |
4781 sudo ln -sf `which go` `sudo which go` || true
4882 sudo go version
49- - uses : actions/checkout@v2
5083
5184 - name : Install test binaries
5285 run : |
53- go install github.com/containernetworking/cni/cnitool@v1.2.2
54- go install github.com/mattn/goveralls@v0.0.12
55- go install github.com/modocache/gover@b58185e
86+ go install github.com/containernetworking/cni/cnitool@latest
87+ go install github.com/mattn/goveralls@latest
88+ go install github.com/modocache/gover@latest
5689
5790 - name : test
5891 run : PATH=$PATH:$(go env GOPATH)/bin COVERALLS=1 ./test_linux.sh
@@ -64,15 +97,15 @@ jobs:
6497 PATH=$PATH:$(go env GOPATH)/bin
6598 gover
6699 goveralls -coverprofile=gover.coverprofile -service=github
67-
68100 test-win :
69101 name : Build and run tests on Windows
102+ needs : build
70103 runs-on : windows-latest
71104 steps :
105+ - uses : actions/checkout@v4
72106 - name : setup go
73- uses : actions/setup-go@v2
107+ uses : actions/setup-go@v5
74108 with :
75- go-version : ${{ env.GO_VERSION }}
76- - uses : actions/checkout@v2
109+ go-version-file : .github/go-version
77110 - name : test
78111 run : bash ./test_windows.sh
0 commit comments