gitlab golang代码校验模版
# demo
check_code:
stage: check
image: golang:1.19
variables:
JOB_STATUS: "$?"
allow_failure: true
except:
- main
- dev
before_script:
- go env -w GOPROXY=https://goproxy.io,direct
- go env -w GOPRIVATE=git.xxx.com/spider
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.3
- echo -e "machine git.xxx.com\nlogin $GITLAB_USERNAME \npassword $GITLAB_PASSWORD" > ~/.netrc
- chmod 600 ~/.netrc
- git config --global --add url."git@hongyuan.com:".insteadof "https://git.xxx.com/"
script:
- go mod vendor
- golangci-lint run
- make all
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
上次更新: 2023-08-22 18:15:32