Mercurial > vim
comparison .github/workflows/coverity.yml @ 31225:39d22d78ce92 v9.0.0946
patch 9.0.0946: CI: Error in Coverity flow is not reported
Commit: https://github.com/vim/vim/commit/ad85af5b384d8d36d7bd3e9b4086190d3a40ab15
Author: K.Takata <kentkt@csc.jp>
Date: Fri Nov 25 00:57:05 2022 +0000
patch 9.0.0946: CI: Error in Coverity flow is not reported
Problem: CI: Error in Coverity flow is not reported.
Solution: Use another way to avoid errors in a forked repository. (Ken
Takata, closes #11609)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 25 Nov 2022 02:00:04 +0100 |
parents | 1fcabfdd0547 |
children | dd85b8e05559 |
comparison
equal
deleted
inserted
replaced
31224:02453993be3a | 31225:39d22d78ce92 |
---|---|
13 | 13 |
14 env: | 14 env: |
15 CC: gcc | 15 CC: gcc |
16 CFLAGS: -Wno-deprecated-declarations | 16 CFLAGS: -Wno-deprecated-declarations |
17 DEBIAN_FRONTEND: noninteractive | 17 DEBIAN_FRONTEND: noninteractive |
18 TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} | |
18 | 19 |
19 steps: | 20 steps: |
20 - name: Checkout repository from github | 21 - name: Checkout repository from github |
22 if: env.TOKEN | |
21 uses: actions/checkout@v3 | 23 uses: actions/checkout@v3 |
22 | 24 |
23 - name: Download Coverity | 25 - name: Download Coverity |
26 if: env.TOKEN | |
24 run: | | 27 run: | |
25 # probably no TOKEN if it was a forked repo | 28 wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=vim" -O coverity_tool.tgz |
26 [ -n "${TOKEN}" ] && wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=vim" -O coverity_tool.tgz || exit 0 | |
27 mkdir cov-scan | 29 mkdir cov-scan |
28 tar ax -f coverity_tool.tgz --strip-components=1 -C cov-scan | 30 tar ax -f coverity_tool.tgz --strip-components=1 -C cov-scan |
29 env: | |
30 TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} | |
31 | 31 |
32 - name: Install packages | 32 - name: Install packages |
33 if: env.TOKEN | |
33 run: | | 34 run: | |
34 sudo apt update && sudo apt install -y \ | 35 sudo apt update && sudo apt install -y \ |
35 autoconf \ | 36 autoconf \ |
36 gettext \ | 37 gettext \ |
37 libcanberra-dev \ | 38 libcanberra-dev \ |
46 desktop-file-utils \ | 47 desktop-file-utils \ |
47 libtool-bin \ | 48 libtool-bin \ |
48 libsodium-dev | 49 libsodium-dev |
49 | 50 |
50 - name: Set up environment | 51 - name: Set up environment |
52 if: env.TOKEN | |
51 run: | | 53 run: | |
52 echo "$(pwd)/cov-scan/bin" >> $GITHUB_PATH | 54 echo "$(pwd)/cov-scan/bin" >> $GITHUB_PATH |
53 ( | 55 ( |
54 echo "NPROC=$(getconf _NPROCESSORS_ONLN)" | 56 echo "NPROC=$(getconf _NPROCESSORS_ONLN)" |
55 echo "CONFOPT=--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp" | 57 echo "CONFOPT=--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp" |
56 ) >> $GITHUB_ENV | 58 ) >> $GITHUB_ENV |
57 | 59 |
58 - name: Configure | 60 - name: Configure |
61 if: env.TOKEN | |
59 run: | | 62 run: | |
60 ./configure --with-features=huge ${CONFOPT} --enable-fail-if-missing | 63 ./configure --with-features=huge ${CONFOPT} --enable-fail-if-missing |
61 # Append various warning flags to CFLAGS. | 64 # Append various warning flags to CFLAGS. |
62 sed -i -f ci/config.mk.sed src/auto/config.mk | 65 sed -i -f ci/config.mk.sed src/auto/config.mk |
63 sed -i -f ci/config.mk.${CC}.sed src/auto/config.mk | 66 sed -i -f ci/config.mk.${CC}.sed src/auto/config.mk |
64 | 67 |
65 - name: Build/scan vim | 68 - name: Build/scan vim |
69 if: env.TOKEN | |
66 run: | | 70 run: | |
67 # if no 'cov-build' there, then just cancel the process | 71 cov-build --dir cov-int make -j${NPROC} |
68 [ -x "$(which cov-build)" ] && cov-build --dir cov-int make -j${NPROC} || exit 0 | |
69 | 72 |
70 - name: Submit results | 73 - name: Submit results |
74 if: env.TOKEN | |
71 run: | | 75 run: | |
72 [ -d 'cov-int' ] && tar zcf cov-scan.tgz cov-int | 76 tar zcf cov-scan.tgz cov-int |
73 [ -n "${TOKEN}" ] \ | 77 curl --form token=$TOKEN \ |
74 && curl --form token=$TOKEN \ | |
75 --form email=$EMAIL \ | 78 --form email=$EMAIL \ |
76 --form file=@cov-scan.tgz \ | 79 --form file=@cov-scan.tgz \ |
77 --form version="$(git rev-parse HEAD)" \ | 80 --form version="$(git rev-parse HEAD)" \ |
78 --form description="Automatic GHA scan" \ | 81 --form description="Automatic GHA scan" \ |
79 'https://scan.coverity.com/builds?project=vim' \ | 82 'https://scan.coverity.com/builds?project=vim' |
80 || exit 0 | |
81 env: | 83 env: |
82 TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} | |
83 EMAIL: ${{ secrets.COVERITY_SCAN_EMAIL }} | 84 EMAIL: ${{ secrets.COVERITY_SCAN_EMAIL }} |