From 0f3bd2acf594e2b1a3fd9bd76fadc5a670351eaa Mon Sep 17 00:00:00 2001 From: Marvin Preuss Date: Fri, 7 Jan 2022 20:21:30 +0100 Subject: [PATCH] ci: using go mod managed tools in drone --- .drone.yml | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index a67dfeb..7b45ef6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,7 +1,20 @@ --- kind: pipeline +type: docker name: default +golang-image: &golang-image golang:1.17-alpine + +gobin-volume: &gobin-volume + name: gobin + path: /go/bin + +usr-volume: &usr-volume + name: usr + path: /usr + +deps-command: &deps-command apk add build-base git + steps: - name: tags image: alpine/git @@ -16,22 +29,45 @@ steps: depends_on: - tags + - name: install-tools + image: *golang-image + volumes: + - *gobin-volume + - *usr-volume + commands: + - *deps-command + - make install-tools + - name: lint - image: golangci/golangci-lint:v1.39.0 + image: *golang-image + volumes: + - *gobin-volume + - *usr-volume commands: - make lint depends_on: + - tags - submodules + - install-tools - name: test - image: golang:latest + image: *golang-image + volumes: + - *gobin-volume + - *usr-volume commands: - make test depends_on: + - install-tools + - tags + - lint - submodules - name: build - image: goreleaser/goreleaser:v0.162.0 + image: *golang-image + volumes: + - *gobin-volume + - *usr-volume commands: - make build depends_on: @@ -43,7 +79,10 @@ steps: - tag - name: release - image: goreleaser/goreleaser:v0.162.0 + image: *golang-image + volumes: + - *gobin-volume + - *usr-volume environment: GITHUB_TOKEN: from_secret: github_token @@ -55,3 +94,10 @@ steps: when: event: - tag + +volumes: + - name: gobin + temp: {} + + - name: usr + temp: {}