coverity.yml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. name: Coverity
  2. on:
  3. schedule:
  4. - cron: '42 0 * * *' # Run once per day, to avoid Coverity's submission limits
  5. workflow_dispatch:
  6. permissions:
  7. contents: read # to fetch code (actions/checkout)
  8. jobs:
  9. scan:
  10. runs-on: ubuntu-20.04
  11. env:
  12. CC: gcc
  13. CFLAGS: -Wno-deprecated-declarations
  14. DEBIAN_FRONTEND: noninteractive
  15. TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
  16. steps:
  17. - name: Checkout repository from github
  18. if: env.TOKEN
  19. uses: actions/checkout@v3
  20. - name: Download Coverity
  21. if: env.TOKEN
  22. run: |
  23. wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=vim" -O coverity_tool.tgz
  24. mkdir cov-scan
  25. tar ax -f coverity_tool.tgz --strip-components=1 -C cov-scan
  26. - name: Install packages
  27. if: env.TOKEN
  28. run: |
  29. sudo apt update && sudo apt install -y \
  30. autoconf \
  31. gettext \
  32. libcanberra-dev \
  33. libperl-dev \
  34. python-dev \
  35. python3-dev \
  36. liblua5.3-dev \
  37. lua5.3 \
  38. ruby-dev \
  39. tcl-dev \
  40. libgtk2.0-dev \
  41. desktop-file-utils \
  42. libtool-bin \
  43. libsodium-dev
  44. - name: Set up environment
  45. if: env.TOKEN
  46. run: |
  47. echo "$(pwd)/cov-scan/bin" >> $GITHUB_PATH
  48. (
  49. echo "NPROC=$(getconf _NPROCESSORS_ONLN)"
  50. echo "CONFOPT=--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
  51. ) >> $GITHUB_ENV
  52. - name: Configure
  53. if: env.TOKEN
  54. run: |
  55. ./configure --with-features=huge ${CONFOPT} --enable-fail-if-missing
  56. # Append various warning flags to CFLAGS.
  57. sed -i -f ci/config.mk.sed src/auto/config.mk
  58. sed -i -f ci/config.mk.${CC}.sed src/auto/config.mk
  59. - name: Build/scan vim
  60. if: env.TOKEN
  61. run: |
  62. cov-build --dir cov-int make -j${NPROC}
  63. - name: Submit results
  64. if: env.TOKEN
  65. run: |
  66. tar zcf cov-scan.tgz cov-int
  67. curl --form token=$TOKEN \
  68. --form email=$EMAIL \
  69. --form file=@cov-scan.tgz \
  70. --form version="$(git rev-parse HEAD)" \
  71. --form description="Automatic GHA scan" \
  72. 'https://scan.coverity.com/builds?project=vim'
  73. env:
  74. EMAIL: ${{ secrets.COVERITY_SCAN_EMAIL }}