Skip to content

Commit 9dc4f32

Browse files
authored
chore: Improve CI robustness, bump and enforce MSRV (#10)
* bump MSRV to 1.75, add it to `Cargo.toml` manifests * CI: add `msrv` job * CI: rename `build_and_test` job to `cross_platform_tests` and add extra checks * envoy-types: generate well-known types corresponding to `protoc` v29.3
1 parent 1cccf1b commit 9dc4f32

File tree

9 files changed

+46
-13
lines changed

9 files changed

+46
-13
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- uses: Swatinem/rust-cache@v2
3333
- run: cargo clippy --workspace --all-features --all-targets
3434

35-
build_and_test:
35+
cross_platform_tests:
3636
runs-on: ${{ matrix.os }}
3737
strategy:
3838
matrix:
@@ -41,8 +41,37 @@ jobs:
4141
steps:
4242
- uses: actions/checkout@v4
4343
- uses: hecrj/setup-rust-action@v2
44+
with:
45+
rust-version: ${{ matrix.toolchain }}
4446
- uses: taiki-e/install-action@protoc
4547
- uses: Swatinem/rust-cache@v2
46-
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
47-
- run: cargo build --verbose
48-
- run: cargo test --doc --all-features --verbose
48+
- run: cargo test --all-features
49+
- uses: taiki-e/install-action@cargo-no-dev-deps
50+
- run: cargo no-dev-deps --no-private check --all-features
51+
- run: cargo no-dev-deps --no-private doc --no-deps --all-features
52+
env:
53+
RUSTDOCFLAGS: "-D warnings"
54+
55+
msrv:
56+
runs-on: ubuntu-latest
57+
steps:
58+
- uses: actions/checkout@v4
59+
- uses: hecrj/setup-rust-action@v2
60+
- run: cargo update
61+
env:
62+
CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS: fallback
63+
- name: Get MSRV from metadata
64+
id: msrv
65+
run: |
66+
MSRV=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].rust_version')
67+
echo "version=${MSRV}" >> $GITHUB_OUTPUT
68+
- uses: hecrj/setup-rust-action@v2
69+
with:
70+
rust-version: ${{ steps.msrv.outputs.version }}
71+
- uses: Swatinem/rust-cache@v2
72+
- run: cargo check --all-features
73+
- uses: taiki-e/install-action@cargo-no-dev-deps
74+
- run: cargo no-dev-deps --no-private check --all-features
75+
- run: cargo no-dev-deps --no-private doc --no-deps --all-features
76+
env:
77+
RUSTDOCFLAGS: "-D warnings"

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[workspace]
22
members = ["envoy-proto-collect", "envoy-types", "examples"]
33
resolver = "2"
4+
5+
[workspace.package]
6+
rust-version = "1.75"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Among other use cases, this crate can be used to implement an
1717

1818
### Rust Version
1919

20-
This project's MSRV is `1.71.1`.
20+
This project's MSRV is `1.75`.
2121

2222
### Dependencies
2323

envoy-proto-collect/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ authors = ["Rafael Lemos <contact@flemosr.com"]
44
edition = "2021"
55
license = "Apache-2.0"
66
publish = false
7+
rust-version = { workspace = true }
78
version = "0.1.0"
89

910
[[bin]]

envoy-types/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ keywords = ["rpc", "grpc", "async", "envoy", "extauthz"]
1212
license = "Apache-2.0"
1313
readme = "../README.md"
1414
repository = "https://github.com/flemosr/envoy-types"
15+
rust-version = { workspace = true }
1516
version = "0.5.3"
1617

1718
[dependencies]

envoy-types/src/generated/google.protobuf.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -850,12 +850,13 @@ pub struct MessageOptions {
850850
}
851851
#[derive(Clone, PartialEq, ::prost::Message)]
852852
pub struct FieldOptions {
853+
/// NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead.
853854
/// The ctype option instructs the C++ code generator to use a different
854855
/// representation of the field than it normally would. See the specific
855856
/// options below. This option is only implemented to support use of
856857
/// \[ctype=CORD\] and \[ctype=STRING\] (the default) on non-repeated fields of
857-
/// type "bytes" in the open source release -- sorry, we'll try to include
858-
/// other types in a future version!
858+
/// type "bytes" in the open source release.
859+
/// TODO: make ctype actually deprecated.
859860
#[prost(
860861
enumeration = "field_options::CType",
861862
optional,
@@ -1073,8 +1074,6 @@ pub mod field_options {
10731074
}
10741075
}
10751076
/// If set to RETENTION_SOURCE, the option will be omitted from the binary.
1076-
/// Note: as of January 2023, support for this is in progress and does not yet
1077-
/// have an effect (b/264593489).
10781077
#[derive(
10791078
Clone,
10801079
Copy,
@@ -1116,8 +1115,7 @@ pub mod field_options {
11161115
}
11171116
/// This indicates the types of entities that the field may apply to when used
11181117
/// as an option. If it is unset, then the field may be freely used as an
1119-
/// option on any kind of entity. Note: as of January 2023, support for this is
1120-
/// in progress and does not yet have an effect (b/264593489).
1118+
/// option on any kind of entity.
11211119
#[derive(
11221120
Clone,
11231121
Copy,
@@ -1907,7 +1905,7 @@ pub enum Edition {
19071905
Edition2023 = 1000,
19081906
Edition2024 = 1001,
19091907
/// Placeholder editions for testing feature resolution. These should not be
1910-
/// used or relyed on outside of tests.
1908+
/// used or relied on outside of tests.
19111909
Edition1TestOnly = 1,
19121910
Edition2TestOnly = 2,
19131911
Edition99997TestOnly = 99997,
33 Bytes
Binary file not shown.

envoy-types/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Among other use cases, this crate can be used to implement an
99
1010
### Rust Version
1111
12-
This project's MSRV is `1.71.1`.
12+
This project's MSRV is `1.75`.
1313
1414
### Dependencies
1515

examples/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ authors = ["Rafael Lemos <contact@flemosr.com"]
44
edition = "2021"
55
license = "Apache-2.0"
66
publish = false
7+
rust-version = { workspace = true }
78
version = "0.1.0"
89

910
[[example]]

0 commit comments

Comments
 (0)