-
Notifications
You must be signed in to change notification settings - Fork 72
/
config.yml
169 lines (155 loc) · 4.44 KB
/
config.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
version: 2.1
orbs:
# codecov: codecov/codecov@3.3.0
rust: circleci/rust@1.6.1
jobs:
build-and-test:
parameters:
rust-version:
type: string
default: "1.75.0"
debian-version:
type: string
default: "bookworm"
rust-features:
type: string
default: "--all-targets"
proptest-enable:
type: boolean
default: false
docker:
- image: rust:<< parameters.rust-version >>-<< parameters.debian-version >>
environment:
RUSTFLAGS: '-D warnings'
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
steps:
- checkout
- run:
name: Rust Version
command: rustc --version; cargo --version
- when:
condition: << parameters.proptest-enable >>
steps:
- run:
name: Enable Running Property Tests
command: scripts/bigdecimal-property-tests enable
- run:
name: Generate cargo.lock
command: cargo generate-lockfile
- restore_cache:
keys:
- bigdecimal-cargo-<< parameters.rust-version >>-{{ checksum "Cargo.lock" }}
- bigdecimal-cargo-
- run:
name: Check
command: cargo check << parameters.rust-features >>
- save_cache:
paths:
- /usr/local/cargo
key: bigdecimal-cargo-<< parameters.rust-version >>-{{ checksum "Cargo.lock" }}
- run:
name: Build
command: cargo build << parameters.rust-features >>
- run:
name: Test
command: cargo test << parameters.rust-features >>
upload-coverage:
parameters:
rust-version:
type: string
debian-version:
type: string
default: "bookworm"
machine: true
steps:
- checkout
- run:
name: Generate Coverage
command: >
docker run
--security-opt seccomp=unconfined
-v "${PWD}:/home"
-e CI=true
$(bash <(curl -s https://codecov.io/env))
akubera/rust-codecov:<< parameters.rust-version >>-<< parameters.debian-version >>
sh -c 'cargo test -q --no-run && kcov-rust && upload-kcov-results-to-codecov'
- store_artifacts:
path: target/cov
lint-check:
docker:
- image: cimg/rust:1.75
steps:
- checkout
- run:
name: Generate cargo.lock
command: cargo generate-lockfile
- rust/build:
with_cache: false
# - rust/format
- rust/clippy
- rust/test
- run:
name: Build examples
command: cargo build --examples
cargo-semver-check:
docker:
- image: "akubera/rust:stable"
steps:
- checkout
- run:
name: Tool Versions
command: >
rustc --version
&& cargo --version
&& cargo semver-checks --version
- run:
name: cargo semver-checks
command: cargo semver-checks --verbose
- run:
name: cargo semver-checks (no-std)
command: cargo semver-checks --verbose --only-explicit-features
workflows:
version: 2
cargo:build-and-test:
jobs:
- rust/lint-test-build:
name: "lint-test-build:stable"
release: true
version: "1.75"
pre-steps:
- checkout
- run:
command: cargo generate-lockfile
- rust/lint-test-build:
name: "lint-test-build:1.56"
release: true
version: "1.56"
- lint-check
- build-and-test:
name: build-and-test:MSRV
rust-version: "1.43.1"
debian-version: "buster"
- build-and-test:
name: build-and-test:MSRV:serde
rust-version: "1.43.1"
debian-version: "buster"
rust-features: "--all-targets --features='serde'"
- build-and-test:
name: build-and-test:latest
- build-and-test:
name: build-and-test:latest:serde
rust-features: "--all-targets --features='serde'"
proptest-enable: true
- build-and-test:
name: build-and-test:no_std
rust-features: "--no-default-features"
- build-and-test:
name: build-and-test:serde+no_std
rust-features: "--no-default-features --features='serde'"
- cargo-semver-check:
requires:
- build-and-test:latest:serde
- upload-coverage:
rust-version: "1.75.0"
requires:
- build-and-test:latest:serde