Skip to content

Commit b4091c4

Browse files
committed
CI: Use cargo 1.84 feature to check MSRV
1 parent 359fd08 commit b4091c4

File tree

5 files changed

+40
-15
lines changed

5 files changed

+40
-15
lines changed

.github/workflows/rust.yml

+21-3
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ jobs:
6767
fail-fast: false
6868
matrix:
6969
rust:
70+
- name: MSRV
71+
toolchain: stable
72+
nightly: false
7073
- name: Stable
7174
toolchain: stable
7275
nightly: false
@@ -79,19 +82,34 @@ jobs:
7982
os: [ubuntu-latest, windows-latest, macOS-latest]
8083
steps:
8184
- uses: actions/checkout@v4
85+
# on non-msrv runs, just download rust
8286
- uses: dtolnay/rust-toolchain@master
8387
with:
8488
toolchain: ${{matrix.rust.toolchain}}
8589
id: rust-toolchain
90+
if: matrix.rust.name != 'MSRV'
91+
# on msrv runs, use stable to generate Cargo.lock then downgrade
92+
- uses: dtolnay/rust-toolchain@stable
93+
if: matrix.rust.name == 'MSRV'
94+
- run: cargo --config 'resolver.incompatible-rust-versions="fallback"' update
95+
- run: echo "rust-version=$(tomlq -r '.workspace.package."rust-version"' Cargo.toml)" >>$GITHUB_OUTPUT
96+
id: msrv
97+
if: matrix.rust.name == 'MSRV'
98+
- uses: dtolnay/rust-toolchain@master
99+
with:
100+
toolchain: ${{steps.msrv.outputs.rust-version}}
101+
id: rust-toolchain
102+
if: matrix.rust.name == 'MSRV'
103+
# the rest is independent of whether msrv is used
86104
- uses: actions/cache@v4
87105
with:
88106
path: |
89107
~/.cargo/git
90108
~/.cargo/registry
91109
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
110+
key: "${{runner.os}} Rust ${{steps.rust-toolchain.outputs.cachekey}}"
111+
- run: cargo test --lib --locked
112+
- run: cargo test --doc --locked
95113

96114
# this tests that all integration tests are successful
97115
integration_tests:

Cargo.toml

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
[workspace]
44
members = ["influxdb", "influxdb_derive", "benches"]
55

6+
[workspace.package]
7+
authors = ["Gero Gerke <[email protected]>", "Dominic <[email protected]>"]
8+
edition = "2018"
9+
rust-version = "1.65"
10+
license = "MIT"
11+
repository = "https://github.com/influxdb-rs/influxdb-rust"
12+
613
[patch.crates-io]
714
influxdb = { path = "./influxdb" }
815
influxdb_derive = { path = "./influxdb_derive" }

README.j2

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
<a href="https://www.rust-lang.org/en-US/">
2626
<img src="https://img.shields.io/badge/Made%20with-Rust-orange.svg" alt='Build with Rust' />
2727
</a>
28-
<a href="https://blog.rust-lang.org/2022/11/03/Rust-1.67.0.html">
29-
<img src="https://img.shields.io/badge/rustc-1.67+-yellow.svg" alt='Minimum Rust Version: 1.67' />
28+
<a href="https://blog.rust-lang.org/2022/11/03/Rust-1.65.0.html">
29+
<img src="https://img.shields.io/badge/rustc-1.65+-yellow.svg" alt='Minimum Rust Version: 1.65' />
3030
</a>
3131
</p>
3232

influxdb/Cargo.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
[package]
44
name = "influxdb"
55
version = "0.7.2"
6-
authors = ["Gero Gerke <[email protected]>"]
7-
edition = "2018"
6+
authors.workspace = true
7+
edition.workspace = true
8+
rust-version.workspace = true
89
description = "InfluxDB Driver for Rust"
910
keywords = ["influxdb", "database", "influx"]
10-
license = "MIT"
11+
license.workspace = true
1112
readme = "README.md"
1213
include = ["src/**/*", "tests/**/*", "Cargo.toml", "LICENSE"]
13-
repository = "https://github.com/influxdb-rs/influxdb-rust"
14-
rust-version = "1.70"
14+
repository.workspace = true
1515

1616
[dependencies]
1717
chrono = { version = "0.4.23", features = ["serde"], default-features = false }

influxdb_derive/Cargo.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
[package]
44
name = "influxdb_derive"
55
version = "0.5.1"
6-
authors = ["Gero Gerke <[email protected]>"]
7-
edition = "2018"
6+
authors.workspace = true
7+
edition.workspace = true
8+
rust-version.workspace = true
89
description = "Private implementation detail of the influxdb crate"
910
keywords = ["influxdb", "database", "influx", "derive"]
10-
license = "MIT"
11+
license.workspace = true
1112
readme = "README.md"
1213
include = ["src/**/*", "tests/**/*", "Cargo.toml", "LICENSE"]
13-
repository = "https://github.com/influxdb-rs/influxdb-rust"
14-
rust-version = "1.70"
14+
repository.workspace = true
1515

1616
[lib]
1717
proc-macro = true

0 commit comments

Comments
 (0)