ci: add pre-commit and remove those checks from Dockerfile
This commit is contained in:
+20
-1
@@ -18,6 +18,25 @@ variables:
|
||||
services:
|
||||
- docker:dind
|
||||
|
||||
run-pre-commit:
|
||||
stage: .pre
|
||||
image: golang:1.19
|
||||
variables:
|
||||
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
|
||||
cache:
|
||||
- key:
|
||||
files:
|
||||
- .pre-commit-config.yaml
|
||||
paths:
|
||||
- ${PRE_COMMIT_HOME}
|
||||
before_script:
|
||||
- apt update && apt install -y python3 python3-pip ruby git
|
||||
- go install github.com/lietu/go-pre-commit@latest
|
||||
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.49.0
|
||||
- pip install pre-commit
|
||||
script:
|
||||
- pre-commit run --all-files
|
||||
|
||||
build:
|
||||
extends: .buildtools
|
||||
stage: build
|
||||
@@ -30,7 +49,7 @@ build:
|
||||
|
||||
vulnerabilities:
|
||||
stage: build
|
||||
image: golang:1.19.2
|
||||
image: golang:1.19.4
|
||||
script:
|
||||
- go install golang.org/x/vuln/cmd/govulncheck@latest
|
||||
- govulncheck ./...
|
||||
|
||||
Reference in New Issue
Block a user