-
Notifications
You must be signed in to change notification settings - Fork 3
/
.drone.yml
69 lines (63 loc) · 1.8 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
matrix:
ELIXIR_TAG:
- 1.4
- 1.5
- 1.6
- 1.7
pipeline:
# Get cached stuff from last run.
restore-cache:
image: drillster/drone-volume-cache
restore: true
cache_key: [DRONE_REPO_OWNER, DRONE_REPO_NAME, ELIXIR_TAG]
mount: [/root/.mix, /root/.hex, ./deps, ./_build, ./.git]
volumes:
- /tmp/cache:/cache
# Run tests for each matrix elixir version.
build:
image: elixir:${ELIXIR_TAG}
commands:
- mix do local.rebar --force, local.hex --force
- MIX_ENV=test mix do deps.get, test
# Check code formatting, linting and dialyze it using latest elixir.
checks:
when:
matrix:
ELIXIR_TAG: 1.7
image: elixir:${ELIXIR_TAG}
commands:
- mix do local.rebar --force, local.hex --force
- MIX_ENV=dev mix do deps.get, format --check-formatted, credo --all, dialyzer
- MIX_ENV=test mix do deps.get, coveralls.json
# Notifies into the Slack channel.
slack-notify:
when:
status: [success, failure]
image: plugins/slack
secrets: [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}}.
# Upload coverage reports, only for the latest elixir.
codecov:
when:
status: [success]
matrix:
ELIXIR_TAG: 1.7
image: robertstettner/drone-codecov
secrets: [codecov_token]
files:
- cover/excoveralls.json
# Store cache every time a build succeeds.
rebuild-cache:
when:
status: [success, failure]
image: drillster/drone-volume-cache
rebuild: true
cache_key: [DRONE_REPO_OWNER, DRONE_REPO_NAME, ELIXIR_TAG]
mount: [/root/.mix, /root/.hex, ./deps, ./_build, ./.git]
volumes:
- /tmp/cache:/cache