include: - template: 'Workflows/MergeRequest-Pipelines.gitlab-ci.yml' stages: - build variables: DOCKER_HOST: tcp://docker:2375/ image: buildtool/build-tools:${BUILDTOOLS_VERSION} run-pre-commit: stage: .pre image: golang:1.20.4 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.52.2 - pip install pre-commit script: - pre-commit run --all-files build: stage: build services: - docker:${DOCKER_DIND_VERSION} script: - build - curl -Os https://uploader.codecov.io/latest/linux/codecov - chmod +x codecov - ./codecov -t ${CODECOV_TOKEN} -R $CI_PROJECT_DIR -C $CI_COMMIT_SHA -r $CI_PROJECT_PATH - push