This repository has been archived by the owner on Jan 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
76 lines (69 loc) · 1.61 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
---
scireum_volumes: &scireum_volumes
- name: docker_socket
path: /var/run/docker.sock
- name: cargo
path: /var/.cargo
kind: pipeline
name: default
platform:
os: linux
arch: amd64
clone:
depth: 1
steps:
- name: compile
image: rust:1.59
volumes: *scireum_volumes
commands:
- export CARGO_HOME="/var/.cargo"
- echo $CARGO_HOME
- cargo build
when:
event:
- push
- name: test
image: rust:1.59
volumes: *scireum_volumes
commands:
- export CARGO_HOME="/var/.cargo"
- echo $CARGO_HOME
- export RUSTFLAGS="-Dwarnings"
- rustup component add rustfmt
- rustup component add clippy
- cargo fmt -- --check
- cargo clippy -- -D warnings
- cargo test
when:
event:
- pull_request
- name: package
image: rust:1.59
volumes: *scireum_volumes
commands:
- export CARGO_HOME="/var/.cargo"
- echo $CARGO_HOME
- export RUSTFLAGS="-Dwarnings"
- rustup component add rustfmt
- rustup component add clippy
- "sed -i 's/0.0.1/${DRONE_TAG}/g' Cargo.toml"
- "sed -i 's/DEVELOPMENT-SNAPSHOT/${DRONE_TAG}/g' src/lib.rs"
- "sed -i 's/NO-REVISION/${DRONE_COMMIT_SHA}/g' src/lib.rs"
- cargo fmt -- --check
- cargo clippy -- -D warnings
- cargo test
- cargo login $CARGO_LOGIN
- cargo publish --allow-dirty
environment:
CARGO_LOGIN:
from_secret: cargo_login
when:
event:
- tag
volumes:
- name: docker_socket
host:
path: /var/run/docker.sock
- name: cargo
host:
path: /var/.cargo