Skip to content

Commit 6a270d0

Browse files
authored
Merge pull request #570 from ClementTsang/update_ci_workflow
update CI workflow to avoid deprecation warnings and build errors
2 parents 611aeea + 791f1ab commit 6a270d0

File tree

4 files changed

+59
-60
lines changed

4 files changed

+59
-60
lines changed

.github/workflows/ci.yml

Lines changed: 55 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -7,87 +7,84 @@ on:
77
branches: [master]
88

99
env:
10-
rust_version: 1.53.0
10+
rust_version: 1.61.0
1111

1212
jobs:
1313
lint:
1414
runs-on: ubuntu-20.04
1515
steps:
16-
- uses: actions/checkout@v2
17-
- uses: actions-rs/toolchain@v1
18-
with:
19-
toolchain: ${{ env.rust_version }}
20-
default: true
21-
components: rustfmt, clippy
22-
- run: cargo fmt -- --check
23-
- run: cargo clippy -- -Dwarnings
24-
- run: cargo test --doc
16+
- uses: actions/checkout@v3
17+
- uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d
18+
with:
19+
toolchain: ${{ env.rust_version }}
20+
components: rustfmt, clippy
21+
- run: cargo fmt -- --check
22+
- run: cargo clippy -- -Dwarnings
23+
- run: cargo test --doc
2524

2625
check:
2726
strategy:
2827
matrix:
2928
include:
30-
- os: macos-11.0
31-
- os: windows-2019
32-
features: cmake-build,libz-static,curl-static
33-
rdkafka-sys-features: cmake-build,libz-static,curl-static
34-
- os: ubuntu-20.04
35-
features: tracing
36-
- os: ubuntu-20.04
37-
features: cmake-build,ssl-vendored,gssapi-vendored,libz-static,curl-static,zstd
38-
rdkafka-sys-features: cmake-build,ssl-vendored,gssapi-vendored,libz-static,curl-static,zstd
29+
- os: macos-11.0
30+
- os: windows-2019
31+
features: cmake-build,libz-static,curl-static
32+
rdkafka-sys-features: cmake-build,libz-static,curl-static
33+
- os: ubuntu-20.04
34+
features: tracing
35+
- os: ubuntu-20.04
36+
features: cmake-build,ssl-vendored,gssapi-vendored,libz-static,curl-static,zstd
37+
rdkafka-sys-features: cmake-build,ssl-vendored,gssapi-vendored,libz-static,curl-static,zstd
3938
runs-on: ${{ matrix.os }}
4039
steps:
41-
- uses: actions/checkout@v2
42-
- uses: actions-rs/toolchain@v1
43-
with:
44-
toolchain: ${{ env.rust_version }}
45-
default: true
46-
- run: cargo build --all-targets --verbose --features "${{ matrix.features }}"
47-
- run: cd rdkafka-sys && cargo test --features "${{ matrix.rdkafka-sys-features }}"
40+
- uses: actions/checkout@v3
41+
- uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d
42+
with:
43+
toolchain: ${{ env.rust_version }}
44+
- run: cargo build --all-targets --verbose --features "${{ matrix.features }}"
45+
- run: cd rdkafka-sys && cargo test --features "${{ matrix.rdkafka-sys-features }}"
4846

4947
# Use the `minimal-versions` resolver to ensure we're not claiming to support
5048
# an older version of a dependency than we actually do.
5149
check-minimal-versions:
5250
runs-on: ubuntu-20.04
5351
steps:
54-
- uses: actions/checkout@v2
55-
- uses: actions-rs/toolchain@v1
56-
with:
57-
# The version of this toolchain doesn't matter much. It's only used to
58-
# generate the minimal-versions lockfile, not to actually run `cargo
59-
# check`.
60-
toolchain: nightly-2021-01-05
61-
components: rustfmt, clippy
62-
- uses: actions-rs/toolchain@v1
63-
with:
64-
toolchain: ${{ env.rust_version }}
65-
default: true
66-
- run: cargo +nightly-2021-01-05 -Z minimal-versions generate-lockfile
67-
- run: cargo check
52+
- uses: actions/checkout@v3
53+
- uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d
54+
with:
55+
# The version of this toolchain doesn't matter much. It's only used to
56+
# generate the minimal-versions lockfile, not to actually run `cargo
57+
# check`.
58+
toolchain: nightly-2021-01-05
59+
components: rustfmt, clippy
60+
- uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d
61+
with:
62+
toolchain: ${{ env.rust_version }}
63+
- run: rustup default ${{ env.rust_version }}
64+
- run: cargo +nightly-2021-01-05 -Z minimal-versions generate-lockfile
65+
- run: cargo check
6866

6967
test:
7068
strategy:
7169
fail-fast: false
7270
matrix:
7371
include:
74-
- confluent-version: 5.3.1
75-
kafka-version: 2.3
76-
- confluent-version: 5.0.3
77-
kafka-version: 2.0
78-
- confluent-version: 4.1.3
79-
kafka-version: 1.1
72+
- confluent-version: 5.3.1
73+
kafka-version: 2.3
74+
- confluent-version: 5.0.3
75+
kafka-version: 2.0
76+
- confluent-version: 4.1.3
77+
kafka-version: 1.1
8078
runs-on: ubuntu-20.04
8179
steps:
82-
- uses: actions/checkout@v2
83-
- uses: actions-rs/toolchain@v1
84-
with:
85-
toolchain: ${{ env.rust_version }}
86-
default: true
87-
- run: sudo apt-get update
88-
- run: sudo apt-get install -qy valgrind
89-
- run: ./test_suite.sh
90-
env:
91-
CONFLUENT_VERSION: ${{ matrix.confluent-version }}
92-
KAFKA_VERSION: ${{ matrix.kafka-version }}
93-
TERM: xterm-256color
80+
- uses: actions/checkout@v3
81+
- uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d
82+
with:
83+
toolchain: ${{ env.rust_version }}
84+
- run: sudo apt-get update
85+
- run: sudo apt-get install -qy valgrind
86+
- run: ./test_suite.sh
87+
env:
88+
CONFLUENT_VERSION: ${{ matrix.confluent-version }}
89+
KAFKA_VERSION: ${{ matrix.kafka-version }}
90+
TERM: xterm-256color

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ re-exported as rdkafka features.
184184

185185
### Minimum supported Rust version (MSRV)
186186

187-
The current minimum supported Rust version (MSRV) is 1.45.0. Note that
187+
The current minimum supported Rust version (MSRV) is 1.61.0. Note that
188188
bumping the MSRV is not considered a breaking change. Any release of
189189
rust-rdkafka may bump the MSRV.
190190

src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ pub trait ClientContext: Send + Sync {
102102
/// The default implementation calls [`ClientContext::stats`] with the
103103
/// decoded statistics, logging an error if the decoding fails.
104104
fn stats_raw(&self, statistics: &[u8]) {
105-
match serde_json::from_slice(&statistics) {
105+
match serde_json::from_slice(statistics) {
106106
Ok(stats) => self.stats(stats),
107107
Err(e) => error!("Could not parse statistics JSON: {}", e),
108108
}

src/util.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,8 @@ where
274274
}
275275
}
276276

277+
// This function is an internal implementation detail
278+
#[allow(clippy::missing_safety_doc)]
277279
pub(crate) unsafe trait KafkaDrop {
278280
const TYPE: &'static str;
279281
const DROP: unsafe extern "C" fn(*mut Self);

0 commit comments

Comments
 (0)