rust.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. name: Check Rust
  2. on:
  3. - push
  4. - pull_request
  5. jobs:
  6. check-rust:
  7. name: Check Rust
  8. runs-on: ubuntu-latest
  9. container: almalinux:9
  10. steps:
  11. - name: Cache rust
  12. uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
  13. with:
  14. path: ~/.cargo
  15. key: check-rust
  16. - name: Install system packages
  17. run: |
  18. dnf -y install dnf-plugins-core
  19. dnf config-manager --set-enabled crb
  20. dnf -y install \
  21. autoconf \
  22. automake \
  23. cargo-vendor \
  24. diffutils \
  25. numactl-devel \
  26. dpdk-devel \
  27. file-devel \
  28. gcc \
  29. gcc-c++ \
  30. git \
  31. jansson-devel \
  32. jq \
  33. lua-devel \
  34. libtool \
  35. libyaml-devel \
  36. libnfnetlink-devel \
  37. libnetfilter_queue-devel \
  38. libnet-devel \
  39. libcap-ng-devel \
  40. libevent-devel \
  41. libmaxminddb-devel \
  42. libpcap-devel \
  43. libtool \
  44. lz4-devel \
  45. make \
  46. nss-devel \
  47. pcre2-devel \
  48. pkgconfig \
  49. python3-devel \
  50. python3-sphinx \
  51. python3-yaml \
  52. sudo \
  53. which \
  54. zlib-devel
  55. - name: Installing Rust
  56. run: |
  57. curl https://sh.rustup.rs -sSf | sh -s -- -y
  58. echo "$HOME/.cargo/bin" >> $GITHUB_PATH
  59. - name: Install cbindgen
  60. run: cargo install --debug cbindgen
  61. - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
  62. - run: ./scripts/bundle.sh
  63. - run: ./autogen.sh
  64. - run: ./configure
  65. - run: cargo clippy --all-features --fix --allow-no-vcs
  66. working-directory: rust
  67. - run: |
  68. diff=$(git diff)
  69. if [ "${diff}" ]; then
  70. echo "::warning ::Clippy --fix made changes, please fix"
  71. fi
  72. - run: cargo clippy --all-features
  73. working-directory: rust