-
Notifications
You must be signed in to change notification settings - Fork 10
/
.drone.yml
74 lines (66 loc) · 1.66 KB
/
.drone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
kind: pipeline
name: default
type: docker
steps:
- name: tests
image: "golang:1.20"
environment:
COVERALLS_TOKEN:
from_secret: coveralls-token
commands:
- 'go vet ./...'
- "go build"
- "go test -v -covermode=atomic -cover -race -coverprofile=coverage.txt"
- "go install github.com/mattn/goveralls@v0.0.11"
- "/go/bin/goveralls -v -coverprofile=coverage.txt -service=drone.io"
- 'echo " ! gofmt -d *.go 2>&1 | read " | bash'
when:
event:
- push
- pull_request
- name: test-docker-build
image: plugins/docker
settings:
repo: oliver006/drone-cloud-run
tags: "latest"
debug: true
dry_run: true
build_args:
- 'TAG=test'
- 'SHA1=${DRONE_COMMIT_SHA}'
username:
from_secret: docker_username
password:
from_secret: docker_password
when:
event:
- push
- pull_request
- name: lint
image: golangci/golangci-lint:latest-alpine
pull: always
commands:
- apk add --update make
- golangci-lint run --tests=false --exclude-use-default
- golangci-lint run -D=errcheck --exclude-use-default
when:
event:
- pull_request
- push
- tag
- name: on-tag-build-and-publish-new-drone-image
image: plugins/docker
settings:
repo: oliver006/drone-cloud-run
tags: "latest,${DRONE_TAG}"
debug: true
build_args:
- 'TAG=${DRONE_TAG}'
- 'SHA1=${DRONE_COMMIT_SHA}'
username:
from_secret: docker_username
password:
from_secret: docker_password
when:
event:
- tag