-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.drone.yml
81 lines (73 loc) · 1.91 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
75
76
77
78
79
80
81
kind: pipeline
name: dymo
volumes:
- name: cache
host:
path: /tmp/drone/cache
services:
- name: database
image: postgres:10.6
environment:
POSTGRES_DB: dymo_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
steps:
# Get cached stuff from last run.
- name: restore-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
restore: true
mount: [/root/.mix, /root/.hex, ./deps, ./_build]
# Run tests.
- name: build
image: elixir:1.9
commands:
- mix do local.rebar --force, local.hex --force
- MIX_ENV=test mix do deps.get, coveralls.json
environment:
POSTGRES_HOST: database
POSTGRES_DB: dymo_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
# Check code formatting, linting and dialyze it using latest elixir.
- name: checks
image: elixir:1.9
commands:
- mix do local.rebar --force, local.hex --force
- MIX_ENV=dev mix do deps.get, dialyzer --halt-exit-status, format --check-formatted
# Webhook our slack channel.
- name: slack-notify
image: plugins/slack
settings:
webhook:
from_secret: slack_webhook
channel: ci
username: Drone
template: >
[{{repo.name}}:{{build.branch}}]
<{{build.link}}|Build {{truncate build.commit 8}}> by {{build.author}}
was a {{build.status}}.
when:
status: [success, failure]
# Upload coverage reports, only for the latest elixir.
- name: codecov
when:
status: [success]
image: plugins/codecov
settings:
token:
from_secret: codecov_token
files:
- cover/excoveralls.json
# Save cache.
- name: rebuild-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
rebuild: true
mount: [/root/.mix, /root/.hex, ./deps, ./_build]