@@ -4,20 +4,37 @@ name: test
44on : ["push", "pull_request"]
55
66env :
7- GO_VERSION : " 1.18 "
7+ GO_VERSION : " 1.22 "
88 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 : go.mod
20+ - uses : ibiqlik/action-yamllint@v3
21+ with :
22+ format : auto
23+ - uses : golangci/golangci-lint-action@v4
24+ with :
25+ version : v1.55.2
26+ args : -v
27+ skip-cache : true
1128 build :
1229 name : Build all linux architectures
30+ needs : lint
1331 runs-on : ubuntu-latest
1432 steps :
33+ - uses : actions/checkout@v4
1534 - name : setup go
16- uses : actions/setup-go@v3
35+ uses : actions/setup-go@v5
1736 with :
18- go-version : ${{ env.GO_VERSION }}
19- - uses : actions/checkout@v3
20-
37+ go-version-file : go.mod
2138 - name : Build on all supported architectures
2239 run : |
2340 set -e
2643 GOARCH=$arch ./build_linux.sh
2744 rm bin/*
2845 done
29-
3046 test-linux :
3147 name : Run tests on Linux amd64
48+ needs : build
3249 runs-on : ubuntu-latest
3350 steps :
3451 - name : Install kernel module
@@ -37,24 +54,21 @@ jobs:
3754 sudo apt-get install linux-modules-extra-$(uname -r)
3855 - name : Install nftables
3956 run : sudo apt-get install nftables
40-
57+ - uses : actions/checkout@v4
4158 - name : setup go
42- uses : actions/setup-go@v3
59+ uses : actions/setup-go@v5
4360 with :
44- go-version : ${{ env.GO_VERSION }}
61+ go-version-file : go.mod
4562 - name : Set up Go for root
4663 run : |
4764 sudo ln -sf `which go` `sudo which go` || true
4865 sudo go version
49- - uses : actions/checkout@v3
5066
5167 - name : Install test binaries
52- env :
53- GO111MODULE : off
5468 run : |
55- go get github.com/containernetworking/cni/cnitool
56- go get github.com/mattn/goveralls
57- go get github.com/modocache/gover
69+ go install github.com/containernetworking/cni/cnitool@latest
70+ go install github.com/mattn/goveralls@latest
71+ go install github.com/modocache/gover@latest
5872
5973 - name : test
6074 run : PATH=$PATH:$(go env GOPATH)/bin COVERALLS=1 ./test_linux.sh
@@ -66,15 +80,15 @@ jobs:
6680 PATH=$PATH:$(go env GOPATH)/bin
6781 gover
6882 goveralls -coverprofile=gover.coverprofile -service=github
69-
7083 test-win :
7184 name : Build and run tests on Windows
85+ needs : build
7286 runs-on : windows-latest
7387 steps :
88+ - uses : actions/checkout@v4
7489 - name : setup go
75- uses : actions/setup-go@v3
90+ uses : actions/setup-go@v5
7691 with :
77- go-version : ${{ env.GO_VERSION }}
78- - uses : actions/checkout@v3
92+ go-version-file : go.mod
7993 - name : test
8094 run : bash ./test_windows.sh
0 commit comments