diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8566e2c..eb8c833 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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: @@ -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: @@ -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 @@ -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: diff --git a/build.rs b/build.rs index b48105b..a323874 100644 --- a/build.rs +++ b/build.rs @@ -280,7 +280,7 @@ fn main() -> Result<(), Box> { // 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()); @@ -290,7 +290,7 @@ fn main() -> Result<(), Box> { 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() diff --git a/src/lib.rs b/src/lib.rs index 0639d09..508f838 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -69,6 +69,7 @@ //! //! #### Read a simple extension //! ```rust +//! # #[cfg(feature="extensions")] //! # fn main() -> Result<(), serde_yaml::Error> { //! use substrait::text::simple_extensions::SimpleExtensions; //! @@ -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