feat: initial version

This commit is contained in:
2023-01-28 12:25:58 +01:00
commit 56f1185444
10 changed files with 428 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
include:
- template: 'Workflows/MergeRequest-Pipelines.gitlab-ci.yml'
image: golang:1.19.5
stages:
- deps
- test
run-pre-commit:
stage: .pre
image: unbound/pre-commit
variables:
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
cache:
- key:
files:
- .pre-commit-config.yaml
paths:
- ${PRE_COMMIT_HOME}
script:
- pre-commit run --all-files
deps:
stage: deps
script:
- go mod download
test:
stage: test
dependencies:
- deps
script:
- CGO_ENABLED=1 go test -mod=readonly -race -coverprofile=coverage.txt -covermode=atomic -coverpkg=$(go list ./... | tr '\n' , | sed 's/,$//') ./...
- go tool cover -html=coverage.txt -o coverage.html
- go tool cover -func=coverage.txt
- 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
vulnerabilities:
stage: test
image: golang:1.19.5
script:
- go install golang.org/x/vuln/cmd/govulncheck@latest
- govulncheck ./...