@@ -8,146 +8,166 @@ jobs:
8
8
- checkout
9
9
- restore_cache :
10
10
keys :
11
- - cargo-v2-{{ checksum "Cargo.toml" }}-
12
- - cargo-v2-
13
- - run : cargo update
11
+ - cargo-v3-{{ checksum "Cargo.toml" }}
12
+ - cargo-v3-
13
+ - run : git submodule sync
14
+ - run : git submodule update --init
14
15
- run : cargo fetch
15
16
- persist_to_workspace :
16
- root : " . "
17
+ root : /mnt/crate
17
18
paths :
18
19
- Cargo.lock
19
20
- save_cache :
20
- key : cargo-v2 -{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock " }}
21
+ key : cargo-v3 -{{ checksum "Cargo.toml" }}
21
22
paths :
22
23
- /usr/local/cargo/registry
23
24
- /usr/local/cargo/git
24
- test :
25
+
26
+ rustfmt :
27
+ docker :
28
+ - image : rust:latest
29
+ working_directory : /mnt/crate
30
+ steps :
31
+ - checkout
32
+ - run :
33
+ name : Install rustfmt
34
+ command : rustup component add rustfmt
35
+ - run :
36
+ name : Print version information
37
+ command : cargo fmt -- --version
38
+ - run :
39
+ name : Check rustfmt
40
+ command : cargo fmt -- --check
41
+
42
+ build_debug :
25
43
docker :
26
44
- image : rust:latest
27
45
working_directory : /mnt/crate
28
46
steps :
29
47
- checkout
30
48
- attach_workspace :
31
- at : " ."
49
+ at : /mnt/crate
50
+ - run : git submodule sync
51
+ - run : git submodule update --init
32
52
- restore_cache :
33
53
keys :
34
- - cargo-v2-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}
54
+ - cargo-v3-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}
55
+ - cargo-v3-{{ checksum "Cargo.toml" }}
56
+ - cargo-v3-
35
57
- run :
36
58
name : Print version information
37
59
command : rustc --version; cargo --version
38
60
- run :
39
- name : Build and test
40
- command : cargo test --frozen --verbose
41
- environment :
42
- # Need this for the coverage run
43
- RUSTFLAGS : " -C link-dead-code"
44
- - run :
45
- name : Prune the output files
46
- command : |
47
- for file in target/debug/* target/debug/.??*; do
48
- [ -d $file -o ! -x $file ] && rm -r $file
49
- done
50
- - persist_to_workspace :
51
- root : " ."
52
- paths :
53
- - target/debug/*
54
- test_release :
61
+ name : Build
62
+ command : cargo build
63
+ test_debug :
55
64
docker :
56
65
- image : rust:latest
57
66
working_directory : /mnt/crate
58
67
steps :
59
68
- checkout
60
69
- attach_workspace :
61
- at : " ."
70
+ at : /mnt/crate
71
+ - run : git submodule sync
72
+ - run : git submodule update --init
62
73
- restore_cache :
63
74
keys :
64
- - cargo-v2-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}
75
+ - cargo-v3-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}
76
+ - cargo-v3-{{ checksum "Cargo.toml" }}
77
+ - cargo-v3-
65
78
- run :
66
79
name : Print version information
67
80
command : rustc --version; cargo --version
68
81
- run :
69
- name : Build and test in release profile
70
- command : cargo test --release --frozen --verbose
71
- test_nightly :
82
+ name : Test
83
+ command : cargo test --verbose
84
+
85
+ build_release :
72
86
docker :
73
- - image : rustlang/ rust:nightly
87
+ - image : rust:latest
74
88
working_directory : /mnt/crate
75
89
steps :
76
90
- checkout
77
91
- attach_workspace :
78
- at : " ."
92
+ at : /mnt/crate
93
+ - run : git submodule sync
94
+ - run : git submodule update --init
79
95
- restore_cache :
80
96
keys :
81
- - cargo-v2-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}
97
+ - cargo-v3-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}
98
+ - cargo-v3-{{ checksum "Cargo.toml" }}
99
+ - cargo-v3-
82
100
- run :
83
101
name : Print version information
84
102
command : rustc --version; cargo --version
85
103
- run :
86
- name : Build and test with nightly Rust
87
- command : cargo test --frozen --verbose
88
- coverage :
104
+ name : Build in release profile
105
+ command : cargo build --release
106
+
107
+ test_release :
89
108
docker :
90
- - image : ragnaroek/kcov:v33
91
- entrypoint : /bin/bash
109
+ - image : rust:latest
92
110
working_directory : /mnt/crate
93
111
steps :
94
112
- checkout
95
113
- attach_workspace :
96
- at : " ."
97
- - run : mkdir target/coverage
114
+ at : /mnt/crate
115
+ - run : git submodule sync
116
+ - run : git submodule update --init
117
+ - restore_cache :
118
+ keys :
119
+ - cargo-v3-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}
120
+ - cargo-v3-{{ checksum "Cargo.toml" }}
121
+ - cargo-v3-
98
122
- run :
99
- name : Rerun the tests collecting coverage
100
- command : |
101
- for file in ./target/debug/*; do
102
- if test -x $file; then
103
- kcov --verify --exclude-pattern=tests \
104
- --exclude-path=src/testmocks.rs \
105
- target/coverage/$(basename $file) \
106
- $file --quiet
107
- fi
108
- done
109
- kcov --merge target/coverage-merged target/coverage/*
110
- - store_artifacts :
111
- path : target/coverage
112
- destination : coverage
113
- - store_artifacts :
114
- path : target/coverage-merged
115
- destination : coverage-merged
116
- - persist_to_workspace :
117
- root : " ."
118
- paths :
119
- - target/coverage
120
- codecov_upload :
123
+ name : Print version information
124
+ command : rustc --version; cargo --version
125
+ - run :
126
+ name : Test
127
+ command : cargo test --release --verbose
128
+
129
+ test_nightly :
121
130
docker :
122
- - image : buildpack-deps:curl
131
+ - image : rustlang/rust:nightly
123
132
working_directory : /mnt/crate
124
133
steps :
125
- # Codecov uploader needs the source and binaries
126
- # exactly as everything was during the test run.
127
134
- checkout
128
135
- attach_workspace :
129
- at : " ."
136
+ at : /mnt/crate
137
+ - restore_cache :
138
+ keys :
139
+ - cargo-v3-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}
140
+ - cargo-v3-{{ checksum "Cargo.toml" }}
141
+ - cargo-v3-
130
142
- run :
131
- name : Upload to Codecov
132
- command : bash <(curl -s https://codecov.io/bash)
143
+ name : Print version information
144
+ command : rustc --version; cargo --version
145
+ - run :
146
+ name : Build and test with nightly Rust
147
+ command : cargo test --verbose
148
+
133
149
134
150
workflows :
135
151
version : 2
136
- test_all_and_coverage :
152
+ test_all :
137
153
jobs :
138
154
- cargo_fetch
139
- - test :
155
+ - rustfmt
156
+ - build_debug :
140
157
requires :
158
+ - rustfmt
141
159
- cargo_fetch
142
- - test_release :
160
+ - build_release :
143
161
requires :
162
+ - rustfmt
144
163
- cargo_fetch
145
- - test_nightly :
164
+ - test_debug :
146
165
requires :
147
- - cargo_fetch
148
- - coverage :
166
+ - build_debug
167
+ - test_release :
149
168
requires :
150
- - test
151
- - codecov_upload :
169
+ - build_release
170
+ - test_nightly :
152
171
requires :
153
- - coverage
172
+ - rustfmt
173
+ - cargo_fetch
0 commit comments