From: Jason Ish Date: Fri, 18 Nov 2022 15:00:20 +0000 (-0600) Subject: github-ci: verify generated rust code is rustfmt and clippy clean X-Git-Tag: suricata-7.0.0-rc1~299 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2a920afb00adf714213d19d719ddd801193afd2;p=thirdparty%2Fsuricata.git github-ci: verify generated rust code is rustfmt and clippy clean --- diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index decc4a2433..37f0e667fe 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -282,12 +282,6 @@ jobs: - run: tar xvf prep/libhtp.tar.gz - run: tar xvf prep/suricata-update.tar.gz - run: tar xvf prep/suricata-verify.tar.gz - - name: Setup cbindgen - run: | - mkdir -p $HOME/.cargo/bin - cp prep/cbindgen $HOME/.cargo/bin - chmod 755 $HOME/.cargo/bin/cbindgen - echo "$HOME/.cargo/bin" >> $GITHUB_PATH - name: Install system packages run: | dnf -y install dnf-plugins-core @@ -295,7 +289,6 @@ jobs: dnf -y install \ autoconf \ automake \ - cargo-vendor \ diffutils \ numactl-devel \ dpdk-devel \ @@ -324,10 +317,15 @@ jobs: python3-devel \ python3-sphinx \ python3-yaml \ - rust-toolset \ sudo \ which \ zlib-devel + - run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y + - run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH + - run: cp prep/cbindgen $HOME/.cargo/bin + - run: chmod 755 $HOME/.cargo/bin/cbindgen + - run: rustup component add rustfmt + - run: rustup component add clippy - name: Build run: | ./autogen.sh @@ -336,6 +334,12 @@ jobs: - run: ./scripts/setup-app-layer.py --parser --logger --detect FooBar payload - run: make -j2 - run: ./src/suricata --list-app-layer-protos | grep foobar + - name: Verify rustfmt + run: rustfmt -v --check src/applayerfoobar/*.rs + working-directory: rust + - name: Verify clippy + run: cargo clippy --all-features + working-directory: rust # This build also creates the distribution package that some other builds # depend on.