Skip to content

Commit

Permalink
Add CI step checking C header up-to-dateness
Browse files Browse the repository at this point in the history
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] #92 (comment)

Signed-off-by: Daniel Müller <[email protected]>
  • Loading branch information
d-e-s-o authored and danielocfb committed Aug 26, 2024
1 parent b3ed772 commit 5f25d02
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion src/bindings.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down

0 comments on commit 5f25d02

Please sign in to comment.