File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717 GO_VERSION : " 1.22.5"
1818
1919jobs :
20+ lint :
21+ name : lint
22+ runs-on : ubuntu-22.04
23+ steps :
24+ - name : Checkout code
25+ uses : actions/checkout@v4
26+ with :
27+ submodules : recursive
28+ - name : Install Go
29+ uses : actions/setup-go@v5
30+ with :
31+ go-version : ${{ env.GO_VERSION }}
32+ - name : Go tidy
33+ run : make tidy
34+ - name : golangci-lint
35+ uses : golangci/golangci-lint-action@v6
36+ with :
37+ version : v1.61.0
38+
39+ test :
40+ name : Unit test
41+ needs : [ lint ]
42+ runs-on : ubuntu-22.04
43+ steps :
44+ - name : Checkout code
45+ uses : actions/checkout@v4
46+ with :
47+ submodules : recursive
48+ - name : Install Go
49+ uses : actions/setup-go@v5
50+ with :
51+ go-version : ${{ env.GO_VERSION }}
52+ - name : Go tidy
53+ run : make tidy
54+ - name : Run tests
55+ run : make test
56+ - name : Upload coverage to Codecov
57+ if : ${{ github.repository == 'Project-HAMi/ascend-device-plugin' }}
58+ uses : codecov/codecov-action@v4
59+ with :
60+ token : ${{ secrets.CODECOV_TOKEN }}
61+ files : ./_output/coverage/coverage.out
62+ flags : unittests
63+ fail_ci_if_error : false
64+ verbose : true
65+
2066 build-vnpu :
2167 runs-on : ubuntu-22.04-arm
2268 container :
4995 env :
5096 IMAGE_NAME : ${{ secrets.IMAGE_NAME || 'projecthami/ascend-device-plugin' }}
5197 runs-on : ubuntu-latest
52- needs : ["build-vnpu"]
98+ needs : ["build-vnpu", "test" ]
5399 steps :
54100 - uses : actions/checkout@v4
55101 with :
Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ all: ascend-device-plugin
88tidy :
99 $(GO ) mod tidy
1010
11+ test :
12+ $(GO ) test -v -coverprofile=_output/coverage/coverage.out ./...
13+
1114docker :
1215 docker build \
1316 --build-arg BASE_IMAGE=ubuntu:20.04 \
@@ -24,4 +27,4 @@ ascend-device-plugin:
2427clean :
2528 rm -rf ./ascend-device-plugin
2629
27- .PHONY : all clean
30+ .PHONY : all tidy test lint clean
You can’t perform that action at this time.
0 commit comments