diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bd9255c9ec9c3b283c9d8a012f3e2c1444c7f007_LmdpdGxhYi1jaS55bWw=..3a41220184cc04a7d7f55d9108efd282fa0107c0_LmdpdGxhYi1jaS55bWw= 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,1 +1,2 @@ +--- stages: @@ -1,7 +2,9 @@ stages: -- test + - test + - lint + - build unit_tests: stage: test image: quay.orus.io/cc/golang:1.17.6 cache: @@ -3,6 +6,7 @@ unit_tests: stage: test image: quay.orus.io/cc/golang:1.17.6 cache: + key: tooling paths: @@ -8,8 +12,28 @@ paths: - - .gopath/pkg/mod - - .gopath/golangci-cache - - .cache/gocache - - tools/bin + - .gopath/pkg/mod + - .gopath/golangci-cache + - .cache/gocache + - tools/bin + script: + - sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b tools/bin + - tools/bin/task test + +lint: + stage: lint + image: quay.orus.io/cc/golang:1.17.6 + cache: + key: tooling + paths: + - .gopath/pkg/mod + - .gopath/golangci-cache + - .cache/gocache + - tools/bin + script: + - GOLANGCI_LINT_ARGS="-j 4" GOLANGCI_LINT_CACHE=$CI_PROJECT_DIR/.gopath/golangci-cache tools/bin/task lint + +build: + stage: build + image: quay.orus.io/cc/golang:1.17.6 artifacts: paths: - build @@ -13,5 +37,11 @@ artifacts: paths: - build - - docs/_build + cache: + key: tooling + paths: + - .gopath/pkg/mod + - .gopath/golangci-cache + - .cache/gocache + - tools/bin script: @@ -17,4 +47,2 @@ script: - - GO111MODULE=on go get -d -u github.com/go-task/task/v3/cmd/task - - GOLANGCI_LINT_ARGS="-j 4" GOLANGCI_LINT_CACHE=$CI_PROJECT_DIR/.gopath/golangci-cache task lint - - task test + - tools/bin/task build