commits.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. name: commit-check
  2. on:
  3. - pull_request
  4. permissions: read-all
  5. env:
  6. DEBIAN_FRONTEND: "noninteractive"
  7. jobs:
  8. check-commits:
  9. name: Commit Check
  10. runs-on: ubuntu-latest
  11. container: ubuntu:20.04
  12. steps:
  13. - name: Caching ~/.cargo
  14. uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
  15. with:
  16. path: ~/.cargo
  17. key: commit-check-cargo
  18. - name: Install dependencies
  19. run: |
  20. apt update
  21. apt -y install \
  22. libpcre2-dev \
  23. build-essential \
  24. autoconf \
  25. automake \
  26. cargo \
  27. curl \
  28. git \
  29. jq \
  30. libtool \
  31. libpcap-dev \
  32. libnet1-dev \
  33. libyaml-0-2 \
  34. libyaml-dev \
  35. libcap-ng-dev \
  36. libcap-ng0 \
  37. libmagic-dev \
  38. libnetfilter-queue-dev \
  39. libnetfilter-queue1 \
  40. libnfnetlink-dev \
  41. libnfnetlink0 \
  42. libhiredis-dev \
  43. libjansson-dev \
  44. libevent-dev \
  45. libevent-pthreads-2.1-7 \
  46. libjansson-dev \
  47. libpython2.7 \
  48. libssl-dev \
  49. make \
  50. parallel \
  51. pkg-config \
  52. python3-yaml \
  53. rustc \
  54. software-properties-common \
  55. zlib1g \
  56. zlib1g-dev
  57. - run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
  58. - name: Installing sccache
  59. run: |
  60. (cd /tmp && curl -OL https://github.com/mozilla/sccache/releases/download/0.2.13/sccache-0.2.13-x86_64-unknown-linux-musl.tar.gz)
  61. mkdir -p "$HOME/.cargo/bin"
  62. (cd "$HOME/.cargo/bin" && tar xvf /tmp/sccache-0.2.13-x86_64-unknown-linux-musl.tar.gz --strip-components=1 --wildcards '*/sccache')
  63. echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
  64. - name: Install cbindgen
  65. run: |
  66. cd $HOME/.cargo/bin
  67. curl -OL https://github.com/eqrion/cbindgen/releases/download/v0.24.3/cbindgen
  68. chmod 755 cbindgen
  69. - uses: actions/checkout@v3.1.0
  70. with:
  71. fetch-depth: 0
  72. # The action above is supposed to do this for us, but it doesn't appear to stick.
  73. - run: /usr/bin/git config --global --add safe.directory /__w/suricata/suricata
  74. - run: git fetch
  75. - run: git clone https://github.com/OISF/libhtp -b 0.5.x
  76. - name: Building all commits
  77. run: |
  78. echo "Building commits from ${GITHUB_BASE_REF}."
  79. for rev in $(git rev-list --reverse origin/${GITHUB_BASE_REF}...); do
  80. git checkout $rev
  81. echo "Building rev ${rev}" | tee -a build_log.txt
  82. ./autogen.sh >> build_log.txt 2>&1
  83. CC="sccache gcc" ./configure --enable-unittests >> build_log.txt 2>&1
  84. if ! make -j2 >> build_log.txt 2>&1; then
  85. echo "::error ::Failed to build rev ${rev}"
  86. tail -n 50 build_log.txt
  87. exit 1
  88. fi
  89. make -ik distclean > /dev/null
  90. done
  91. - run: sccache -s
  92. - uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb
  93. name: Uploading build log
  94. if: always()
  95. with:
  96. name: build_log
  97. path: build_log.txt