Skip to content

Commit

Permalink
chore: fix build script warning, fix doctest with default features (#200
Browse files Browse the repository at this point in the history
)

Also tests without default features in CI.
  • Loading branch information
mbrobbel authored Jul 10, 2024
1 parent c67f7e0 commit 0752984
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-check-
${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-
${{ runner.os }}-cargo-
- run: cargo check --all-targets --no-default-features --features protoc
- run: cargo check --all-targets --all-features

check:
Expand All @@ -53,6 +54,7 @@ jobs:
${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-check-
${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-
${{ runner.os }}-cargo-
- run: cargo check --all-targets --no-default-features --features protoc
- run: cargo check --all-targets --all-features

test:
Expand All @@ -78,8 +80,10 @@ jobs:
${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-test-
${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-
${{ runner.os }}-cargo-
- run: cargo test --all-targets --no-default-features --features protoc
- run: cargo test --all-targets --all-features
- run: cargo test --doc --all-features
- run: cargo test --doc --no-default-features --features protoc

rustfmt:
name: Rustfmt
Expand Down Expand Up @@ -116,6 +120,7 @@ jobs:
${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-clippy-
${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-
${{ runner.os }}-cargo-
- run: cargo clippy --all-targets --no-default-features --features protoc -- -Dwarnings
- run: cargo clippy --all-targets --all-features -- -Dwarnings

package:
Expand Down
4 changes: 2 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ fn main() -> Result<(), Box<dyn Error>> {
// for use in docker build where file changes can be wonky
println!("cargo:rerun-if-env-changed=FORCE_REBUILD");

let version = substrait_version()?;
let _version = substrait_version()?;

#[cfg(feature = "protoc")]
std::env::set_var("PROTOC", protobuf_src::protoc());
Expand All @@ -290,7 +290,7 @@ fn main() -> Result<(), Box<dyn Error>> {
text(out_dir.as_path())?;

#[cfg(feature = "extensions")]
extensions(version, out_dir.as_path())?;
extensions(_version, out_dir.as_path())?;

let protos = WalkDir::new(PROTO_ROOT)
.into_iter()
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
//!
//! #### Read a simple extension
//! ```rust
//! # #[cfg(feature="extensions")]
//! # fn main() -> Result<(), serde_yaml::Error> {
//! use substrait::text::simple_extensions::SimpleExtensions;
//!
Expand Down Expand Up @@ -96,6 +97,8 @@
//! assert_eq!(simple_extension.scalar_functions.len(), 1);
//! assert_eq!(simple_extension.scalar_functions[0].name, "add");
//! # Ok(()) }
//! # #[cfg(not(feature="extensions"))]
//! # fn main() {}
//! ```
//!
//! [pbjson]: https://docs.rs/pbjson
Expand Down

0 comments on commit 0752984

Please sign in to comment.