ci: using go mod managed tools in drone
This commit is contained in:
parent
75fa1f4f0a
commit
0f3bd2acf5
54
.drone.yml
54
.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: {}
|
||||
|
Loading…
Reference in New Issue
Block a user