Skip to content

Commit

Permalink
check generated code in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
youyuanwu committed Jan 8, 2025
1 parent 4124e45 commit b8e6e9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/cargo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-xlarge]
features: ["", "--features static", "--features schannel", "--features schannel,static"]
features: ["", "--features static", "--features schannel", "--features schannel,static", "--features overwrite"]
exclude:
- os: ubuntu-latest
features: "--features schannel"
Expand Down Expand Up @@ -60,6 +60,8 @@ jobs:
run: cargo clippy --all-targets -- -D warnings
- name: Cargo build
run: cargo build --all ${{ matrix.features }}
- name: Check all generated files with git
run: git diff --exit-code
- name: Cargo test
run: cargo test --all ${{ matrix.features }}
- name: Cargo Publish (dry run)
Expand Down
5 changes: 3 additions & 2 deletions scripts/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,13 @@ fn main() {
println!("cargo:rustc-link-lib=static=msquic");
}

#[cfg(feature = "overwrite")]
#[cfg(all(feature = "overwrite", not(target_os = "macos")))]
overwrite_bindgen();
}

/// Read the c header and generate rust bindings.
#[cfg(feature = "overwrite")]
/// TODO: macos currently uses linux bindings.
#[cfg(all(feature = "overwrite", not(target_os = "macos")))]
fn overwrite_bindgen() {
let manifest_dir = std::path::PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
let root_dir = manifest_dir;
Expand Down

0 comments on commit b8e6e9a

Please sign in to comment.