Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5ae03bc

Browse files
committed
update CircleCI
1 parent a011d0d commit 5ae03bc

File tree

1 file changed

+96
-76
lines changed

1 file changed

+96
-76
lines changed

.circleci/config.yml

Lines changed: 96 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -8,146 +8,166 @@ jobs:
88
- checkout
99
- restore_cache:
1010
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
1415
- run: cargo fetch
1516
- persist_to_workspace:
16-
root: "."
17+
root: /mnt/crate
1718
paths:
1819
- Cargo.lock
1920
- save_cache:
20-
key: cargo-v2-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}
21+
key: cargo-v3-{{ checksum "Cargo.toml" }}
2122
paths:
2223
- /usr/local/cargo/registry
2324
- /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:
2543
docker:
2644
- image: rust:latest
2745
working_directory: /mnt/crate
2846
steps:
2947
- checkout
3048
- attach_workspace:
31-
at: "."
49+
at: /mnt/crate
50+
- run: git submodule sync
51+
- run: git submodule update --init
3252
- restore_cache:
3353
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-
3557
- run:
3658
name: Print version information
3759
command: rustc --version; cargo --version
3860
- 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:
5564
docker:
5665
- image: rust:latest
5766
working_directory: /mnt/crate
5867
steps:
5968
- checkout
6069
- attach_workspace:
61-
at: "."
70+
at: /mnt/crate
71+
- run: git submodule sync
72+
- run: git submodule update --init
6273
- restore_cache:
6374
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-
6578
- run:
6679
name: Print version information
6780
command: rustc --version; cargo --version
6881
- 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:
7286
docker:
73-
- image: rustlang/rust:nightly
87+
- image: rust:latest
7488
working_directory: /mnt/crate
7589
steps:
7690
- checkout
7791
- attach_workspace:
78-
at: "."
92+
at: /mnt/crate
93+
- run: git submodule sync
94+
- run: git submodule update --init
7995
- restore_cache:
8096
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-
82100
- run:
83101
name: Print version information
84102
command: rustc --version; cargo --version
85103
- 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:
89108
docker:
90-
- image: ragnaroek/kcov:v33
91-
entrypoint: /bin/bash
109+
- image: rust:latest
92110
working_directory: /mnt/crate
93111
steps:
94112
- checkout
95113
- 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-
98122
- 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:
121130
docker:
122-
- image: buildpack-deps:curl
131+
- image: rustlang/rust:nightly
123132
working_directory: /mnt/crate
124133
steps:
125-
# Codecov uploader needs the source and binaries
126-
# exactly as everything was during the test run.
127134
- checkout
128135
- 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-
130142
- 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+
133149

134150
workflows:
135151
version: 2
136-
test_all_and_coverage:
152+
test_all:
137153
jobs:
138154
- cargo_fetch
139-
- test:
155+
- rustfmt
156+
- build_debug:
140157
requires:
158+
- rustfmt
141159
- cargo_fetch
142-
- test_release:
160+
- build_release:
143161
requires:
162+
- rustfmt
144163
- cargo_fetch
145-
- test_nightly:
164+
- test_debug:
146165
requires:
147-
- cargo_fetch
148-
- coverage:
166+
- build_debug
167+
- test_release:
149168
requires:
150-
- test
151-
- codecov_upload:
169+
- build_release
170+
- test_nightly:
152171
requires:
153-
- coverage
172+
- rustfmt
173+
- cargo_fetch

0 commit comments

Comments
 (0)