ci: add checking of pre-commit rules

This commit is contained in:
2022-09-30 23:46:11 +02:00
parent cfb7cc4f2f
commit 757dbe4349
2 changed files with 20 additions and 4 deletions
+19
View File
@@ -9,6 +9,25 @@ variables:
image: buildtool/build-tools:${BUILDTOOLS_VERSION}
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:
stage: build
services: