github-ci: test that bindgen bindings are up to date

Regenerates the `sys.rs` and looks for any difference. Check will fail
if there is a difference.

Ticket: #7341
pull/12590/head
Jason Ish 1 month ago committed by Victor Julien
parent 4554c4778d
commit 45641eab1e

@ -21,20 +21,18 @@ jobs:
runs-on: ubuntu-latest
container: almalinux:9
steps:
- name: Cache rust
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
with:
path: ~/.cargo
key: check-rust
- name: Install system packages
run: |
dnf -y install dnf-plugins-core
dnf -y install dnf-plugins-core epel-release
dnf config-manager --set-enabled crb
dnf -y install \
autoconf \
automake \
cargo-vendor \
bindgen \
cargo \
cbindgen \
clang-devel \
clippy \
diffutils \
numactl-devel \
dpdk-devel \
@ -61,21 +59,28 @@ jobs:
python3-devel \
python3-sphinx \
python3-yaml \
rust \
rustfmt \
sudo \
which \
zlib-devel
- name: Installing Rust
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install cbindgen
run: cargo install --debug cbindgen
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- run: git config --global --add safe.directory /__w/suricata/suricata
- run: ./scripts/bundle.sh
- run: ./autogen.sh
- run: ./configure --enable-warnings
- name: Checking bindgen output
working-directory: rust
run: |
bindgen --version
make check-bindgen-bindings
diff=$(git diff sys)
if [ "${diff}" ]; then
echo "${diff}"
echo "::error ::Bindgen bindings appear to be out of date"
exit 1
fi
- run: cargo clippy --all-features --fix --allow-no-vcs
working-directory: rust
- run: |

Loading…
Cancel
Save