gouick/.drone.yml

91 lines
1.7 KiB
YAML
Raw Normal View History

2022-08-01 22:06:36 +00:00
---
kind: pipeline
type: docker
name: testing
platform:
os: linux
arch: amd64
steps:
- name: environment
image: golang:1.18
commands:
- go version
- go env
volumes:
- name: gopath
path: /go
- name: tools
image: golang:1.18
commands:
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.47.3
- go install github.com/tebeka/go2xunit@latest
- go install github.com/t-yuki/gocover-cobertura@latest
volumes:
- name: gopath
path: /go
2022-08-05 14:24:24 +00:00
depends_on:
- environment
2022-08-01 22:06:36 +00:00
2022-08-05 14:19:38 +00:00
- name: tidy
image: golang:1.18
commands:
- go mod tidy
- git diff --exit-code -- go.mod go.sum
volumes:
- name: gopath
path: /go
2022-08-05 14:24:24 +00:00
depends_on:
- tools
2022-08-05 14:19:38 +00:00
2022-08-01 22:06:36 +00:00
- name: lint
image: golang:1.18
commands:
- echo 'Running linting'
- golangci-lint run
volumes:
- name: gopath
path: /go
2022-08-05 14:24:24 +00:00
depends_on:
- tools
2022-08-01 22:06:36 +00:00
- name: test
image: golang:1.18
commands:
- go test -cover -v ./...
volumes:
- name: gopath
path: /go
2022-08-05 14:24:24 +00:00
depends_on:
- tools
2022-08-01 22:06:36 +00:00
- name: send telegram notification
image: appleboy/drone-telegram
settings:
token:
from_secret: telegram_token
to:
from_secret: telegram_chat_id
message: >
{{#success build.status}}
2022-08-03 20:04:13 +00:00
✅ Build *#{{build.number}}* of *{{repo.name}}* succeeded.
2022-08-01 22:06:36 +00:00
{{else}}
2022-08-03 20:04:13 +00:00
❌ Build *#{{build.number}}* of *{{repo.name}}* failed.
2022-08-01 22:06:36 +00:00
{{/success}}
2022-08-03 13:42:43 +00:00
2022-08-03 20:04:13 +00:00
📝 Commit on *{{commit.branch}}*:
2022-08-03 13:42:43 +00:00
``` {{commit.message}} ```
🌐 {{ build.link }}
format: markdown
2022-08-01 22:06:36 +00:00
when:
status:
- failure
- success
volumes:
- name: gopath
temp: {}