From d1a3dddefea3b7d0b85cf7d6a05f662d4db4c5f1 Mon Sep 17 00:00:00 2001 From: Lyuben Penkovski <lyuben.penkovski@vereign.com> Date: Wed, 1 Jun 2022 14:28:38 +0300 Subject: [PATCH] Add basic pipeline files --- .gitattributes | 1 + .gitlab-ci.yml | 25 +++++++++++++++++++++++++ .golangci.yml | 31 +++++++++++++++++++++++++++++++ go.mod | 3 +++ 4 files changed, 60 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitlab-ci.yml create mode 100644 .golangci.yml create mode 100644 go.mod diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6f7f652 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +vendor/**/* -diff diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..e5a6f57 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,25 @@ +stages: + - test + +before_script: + - ln -s /builds /go/src/code.vereign.com + - cd /go/src/code.vereign.com/${CI_PROJECT_PATH} + +lint: + image: golangci/golangci-lint:v1.44.2 + stage: test + tags: + - amd64-docker + script: + - golangci-lint --version + - golangci-lint run + +unit tests: + image: golang:1.17.8 + stage: test + tags: + - amd64-docker + script: + - go version + - go test -race ./... -coverprofile=coverage.out + - go tool cover -func=coverage.out diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..e6ba71d --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,31 @@ +run: + deadline: 5m + skip-dirs: + - vendor/ + - .*fakes/ + - .*generated/ + skip-files: + - .*generated.go + +linters: + disable-all: true + enable: + - megacheck + - govet + - deadcode + - errcheck + - goconst + - gocyclo + - goimports + - revive + - gosec + - ineffassign + - nakedret + - staticcheck + - structcheck + - unconvert + - varcheck + - vet + - vetshadow + - misspell + - staticcheck diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..b764780 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module code.vereign.com/gaiax/tsa/infohub + +go 1.17 -- GitLab