bindgen: use bindgen to provide Rust bindings to C - v6 #5985
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check Rust | |
on: | |
push: | |
paths-ignore: | |
- "doc/**" | |
pull_request: | |
paths-ignore: | |
- "doc/**" | |
permissions: | |
contents: read # to fetch code (actions/checkout) | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
check-rust: | |
name: Check Rust | |
runs-on: ubuntu-latest | |
container: almalinux:9 | |
steps: | |
- name: Install system packages | |
run: | | |
dnf -y install dnf-plugins-core epel-release | |
dnf config-manager --set-enabled crb | |
dnf -y install \ | |
autoconf \ | |
automake \ | |
bindgen \ | |
cargo \ | |
cbindgen \ | |
clang-devel \ | |
clippy \ | |
diffutils \ | |
numactl-devel \ | |
dpdk-devel \ | |
file-devel \ | |
gcc \ | |
gcc-c++ \ | |
git \ | |
jansson-devel \ | |
jq \ | |
libtool \ | |
libyaml-devel \ | |
libnfnetlink-devel \ | |
libnetfilter_queue-devel \ | |
libnet-devel \ | |
libcap-ng-devel \ | |
libevent-devel \ | |
libmaxminddb-devel \ | |
libpcap-devel \ | |
libtool \ | |
lz4-devel \ | |
make \ | |
pcre2-devel \ | |
pkgconfig \ | |
python3-devel \ | |
python3-sphinx \ | |
python3-yaml \ | |
rust \ | |
rustfmt \ | |
sudo \ | |
which \ | |
zlib-devel | |
- 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 update-bindings | |
diff=$(git diff src/_sys.rs) | |
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: | | |
diff=$(git diff) | |
if [ "${diff}" ]; then | |
echo "${diff}" | |
echo "::error ::Clippy --fix made changes, please fix" | |
exit 1 | |
fi | |
- run: cargo clippy --all-features --all-targets | |
working-directory: rust | |
# especially without debug feature | |
- run: cargo clippy | |
working-directory: rust |