12
12
name : README Format Check
13
13
runs-on : ubuntu-latest
14
14
steps :
15
- - uses : actions/checkout@v4
15
+ - uses : actions/checkout@v5
16
16
- uses : docker://codeberg.org/msrd0/cargo-doc2readme:nightly
17
17
with :
18
18
entrypoint : cargo
@@ -23,41 +23,27 @@ jobs:
23
23
name : Style Check (clippy)
24
24
runs-on : ubuntu-latest
25
25
steps :
26
- - uses : actions/checkout@v4
27
- - uses : dtolnay/rust-toolchain@1.75 .0
26
+ - uses : actions/checkout@v5
27
+ - uses : dtolnay/rust-toolchain@1.88 .0
28
28
with :
29
29
components : clippy
30
+ - name : Update Cargo.lock
31
+ run : cargo --config 'resolver.incompatible-rust-versions="fallback"' update
30
32
- name : Check Clippy lints (reqwest)
31
- run : cargo clippy --manifest-path influxdb/Cargo.toml --all-targets --no-default-features --features serde,derive,reqwest-client-rustls -- -D warnings
32
- - name : Check Clippy lints (surf)
33
- run : cargo clippy --manifest-path influxdb/Cargo.toml --all-targets --no-default-features --features serde,derive,hyper-client -- -D warnings
33
+ run : cargo clippy --manifest-path influxdb/Cargo.toml --locked --all-targets --no-default-features --features chrono,time,serde,derive,reqwest-client-rustls -- -D warnings
34
34
35
35
# this checks that the code is formatted with rustfmt
36
36
rustfmt :
37
37
name : Style Checks (rustfmt)
38
38
runs-on : ubuntu-latest
39
39
steps :
40
- - uses : actions/checkout@v4
40
+ - uses : actions/checkout@v5
41
41
- uses : dtolnay/rust-toolchain@nightly
42
42
with :
43
43
components : rustfmt
44
44
- name : Check code formatting
45
45
run : cargo fmt --all -- --check
46
46
47
- # this checks the msrv
48
- msrv :
49
- name : Verify MSRV
50
- runs-on : ubuntu-latest
51
- steps :
52
- - uses : actions/checkout@v4
53
- - uses : baptiste0928/cargo-install@v3
54
- with :
55
- crate : cargo-msrv
56
- - name : Verify minimum rust version of influxdb crate
57
- run : cargo msrv --path influxdb --output-format json verify
58
- - name : Verify minimum rust version of influxdb_derive crate
59
- run : cargo msrv --path influxdb_derive --output-format json verify
60
-
61
47
# this tests that all unit and doc tests are successful
62
48
unit_tests :
63
49
name : Unit and Doc Tests (Rust ${{matrix.rust.name}} on ${{matrix.os}})
@@ -77,21 +63,51 @@ jobs:
77
63
toolchain : nightly
78
64
nightly : true
79
65
os : [ubuntu-latest, windows-latest, macOS-latest]
66
+ include :
67
+ - rust :
68
+ name : MSRV
69
+ toolchain : stable
70
+ nightly : false
71
+ os : ubuntu-latest
80
72
steps :
81
- - uses : actions/checkout@v4
73
+ - uses : actions/checkout@v5
82
74
- uses : dtolnay/rust-toolchain@master
83
75
with :
84
76
toolchain : ${{matrix.rust.toolchain}}
85
77
id : rust-toolchain
78
+ - run : cargo --config 'resolver.incompatible-rust-versions="fallback"' update
79
+ # on msrv runs, downgrade rust after generating the Cargo.lock file
80
+ - run : sudo apt -y update && sudo apt -y install --no-install-recommends yq
81
+ if : matrix.rust.name == 'MSRV'
82
+ - run : echo "rust-version=$(tomlq -r '.workspace.package."rust-version"' Cargo.toml)" >>$GITHUB_OUTPUT
83
+ id : msrv
84
+ if : matrix.rust.name == 'MSRV'
85
+ - uses : dtolnay/rust-toolchain@master
86
+ with :
87
+ toolchain : ${{steps.msrv.outputs.rust-version}}
88
+ id : msrv-toolchain
89
+ if : matrix.rust.name == 'MSRV'
90
+ # on non-msrv runs, use one cache key ...
91
+ - uses : actions/cache@v4
92
+ with :
93
+ path : |
94
+ ~/.cargo/git
95
+ ~/.cargo/registry
96
+ target
97
+ key : " ${{runner.os}} Rust ${{steps.rust-toolchain.outputs.cachekey}}"
98
+ if : matrix.rust.name != 'MSRV'
99
+ # ... and on msrv runs, use another
86
100
- uses : actions/cache@v4
87
101
with :
88
102
path : |
89
103
~/.cargo/git
90
104
~/.cargo/registry
91
105
target
92
- key : " ${{matrix.rust.toolchain}} on ${{runner.os}} Rust ${{steps.rust-toolchain.outputs.cachekey}}"
93
- - run : cargo test --lib
94
- - run : cargo test --doc
106
+ key : " ${{runner.os}} Rust ${{steps.msrv-toolchain.outputs.cachekey}}"
107
+ if : matrix.rust.name == 'MSRV'
108
+ # finally we can run tests
109
+ - run : cargo test --lib --locked --features 'chrono time serde derive'
110
+ - run : cargo test --doc --locked --features 'chrono time serde derive'
95
111
96
112
# this tests that all integration tests are successful
97
113
integration_tests :
@@ -106,10 +122,6 @@ jobs:
106
122
toolchain : stable
107
123
nightly : false
108
124
http-backend :
109
- - curl-client
110
- - h1-client
111
- - h1-client-rustls
112
- - hyper-client
113
125
- reqwest-client-rustls
114
126
- reqwest-client-native-tls
115
127
- reqwest-client-native-tls-vendored
@@ -140,7 +152,7 @@ jobs:
140
152
DOCKER_INFLUXDB_INIT_BUCKET : mydb
141
153
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN : admintoken
142
154
steps :
143
- - uses : actions/checkout@v4
155
+ - uses : actions/checkout@v5
144
156
- uses : dtolnay/rust-toolchain@master
145
157
with :
146
158
toolchain : ${{matrix.rust.toolchain}}
@@ -154,10 +166,12 @@ jobs:
154
166
key : " ${{runner.os}} Rust ${{steps.rust-toolchain.outputs.cachekey}}"
155
167
- name : Run tests
156
168
run : |
157
- for test in integration_tests{,_v2}
158
- do
159
- cargo test -p influxdb --no-default-features --features 'serde derive ${{matrix.http-backend}}' --no-fail-fast --test $test
160
- done
169
+ cargo test -p influxdb \
170
+ --no-default-features \
171
+ --features "serde derive chrono time ${{matrix.http-backend}}" \
172
+ --no-fail-fast \
173
+ --test integration_tests \
174
+ --test integration_tests_v2
161
175
162
176
# this uses cargo-tarpaulin to inspect the code coverage
163
177
coverage :
@@ -180,7 +194,7 @@ jobs:
180
194
INFLUXDB_USER_PASSWORD : password
181
195
182
196
steps :
183
- - uses : actions/checkout@v4
197
+ - uses : actions/checkout@v5
184
198
- uses : dtolnay/rust-toolchain@stable
185
199
id : rust-toolchain
186
200
- name : Get Tarpaulin Version
@@ -203,7 +217,7 @@ jobs:
203
217
cargo tarpaulin -v \
204
218
--target-dir target/tarpaulin \
205
219
--workspace \
206
- --features serde,derive \
220
+ --features chrono,time, serde,derive \
207
221
--exclude-files 'derive/*' \
208
222
--exclude-files 'target/*' \
209
223
--ignore-panics --ignore-tests \
@@ -225,10 +239,10 @@ jobs:
225
239
- coverage
226
240
if : github.ref == 'refs/heads/main'
227
241
steps :
228
- - uses : actions/checkout@v4
242
+ - uses : actions/checkout@v5
229
243
with :
230
244
ref : gh-pages
231
- - uses : actions/download-artifact@v4
245
+ - uses : actions/download-artifact@v5
232
246
with :
233
247
name : tarpaulin-report
234
248
- run : |
0 commit comments