From 5f25d02f446ce2e704f4941bb3a957d26667d91b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20M=C3=BCller?= Date: Mon, 26 Aug 2024 11:10:25 -0700 Subject: [PATCH] Add CI step checking C header up-to-dateness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of having to wonder whether the generated bindings.h header need an update [0] after, say, a libbpf submodule bump, let's just make sure that we have a CI job that checks for any mismatches and flags them accordingly. [0] https://github.com/libbpf/libbpf-sys/pull/92#issuecomment-2253251109 Signed-off-by: Daniel Müller --- .github/workflows/ci.yml | 15 +++++++++++++++ src/bindings.rs | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 864be59..26d3c7f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -168,6 +168,21 @@ jobs: cargo update cargo build + c-header: + name: Check generated C header + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install system dependencies + run: sudo apt-get install libelf-dev + - uses: dtolnay/rust-toolchain@stable + - run: cargo check --features bindgen-source + - name: Check that C header is up-to-date + run: git diff --exit-code || + (echo "!!!! CHECKED IN C HEADER IS OUTDATED !!!!" && false) + publish: name: Publish to crates.io if: github.ref == 'refs/heads/master' && github.ref_type == 'tag' diff --git a/src/bindings.rs b/src/bindings.rs index 3e35881..cf04aae 100644 --- a/src/bindings.rs +++ b/src/bindings.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]