-
Notifications
You must be signed in to change notification settings - Fork 3
/
bitbucket-pipelines.yml
executable file
·71 lines (68 loc) · 1.72 KB
/
bitbucket-pipelines.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
image: rust:latest
clone:
depth: full
definitions:
caches:
cargo: /usr/local/cargo
cargo-target: $BITBUCKET_CLONE_DIR/target
steps:
- step: &static-code-analysis
name: Static Code Analysis
caches:
- cargo
script:
- rustup component add rustfmt
- cargo fmt --all -- --check
- rustup component add clippy
- cargo clippy --all-targets --all-features -- -D warnings
- step: &build
name: Build
caches:
- cargo
- cargo-target
script:
- cargo build -v
- step: &test
name: Test
caches:
- cargo
- cargo-target
script:
- cargo test -v --no-fail-fast
- command cargo tarpaulin -V &> /dev/null || cargo install cargo-tarpaulin
- cargo tarpaulin --ciserver bitbucket --coveralls $CODECOV_TOKEN
- curl -Os https://uploader.codecov.io/latest/linux/codecov && chmod +x codecov && ./codecov
- step: &audit
name: Audit
caches:
- cargo
script:
- cargo install cargo-audit
- cargo audit
- step: &deployment
name: Deploy to Crates
deployment: Crates
caches:
- cargo
- cargo-target
trigger: manual
script:
- cargo login $CARGO_TOKEN
- cargo publish
pipelines:
default:
- step: *static-code-analysis
- step: *test
branches:
master:
- step: *static-code-analysis
- step: *audit
- step: *build
- step: *test
- step: *deployment
pull-requests:
'**':
- step: *static-code-analysis
- step: *audit
- step: *build
- step: *test