Skip to content

Commit

Permalink
patch 9.0.0946: CI: Error in Coverity flow is not reported
Browse files Browse the repository at this point in the history
Problem:    CI: Error in Coverity flow is not reported.
Solution:   Use another way to avoid errors in a forked repository. (Ken
            Takata, closes #11609)
  • Loading branch information
k-takata authored and brammool committed Nov 25, 2022
1 parent 637862f commit ad85af5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/coverity.yml
Expand Up @@ -15,21 +15,22 @@ jobs:
CC: gcc
CFLAGS: -Wno-deprecated-declarations
DEBIAN_FRONTEND: noninteractive
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}

steps:
- name: Checkout repository from github
if: env.TOKEN
uses: actions/checkout@v3

- name: Download Coverity
if: env.TOKEN
run: |
# probably no TOKEN if it was a forked repo
[ -n "${TOKEN}" ] && wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=vim" -O coverity_tool.tgz || exit 0
wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=vim" -O coverity_tool.tgz
mkdir cov-scan
tar ax -f coverity_tool.tgz --strip-components=1 -C cov-scan
env:
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
- name: Install packages
if: env.TOKEN
run: |
sudo apt update && sudo apt install -y \
autoconf \
Expand All @@ -48,6 +49,7 @@ jobs:
libsodium-dev
- name: Set up environment
if: env.TOKEN
run: |
echo "$(pwd)/cov-scan/bin" >> $GITHUB_PATH
(
Expand All @@ -56,28 +58,27 @@ jobs:
) >> $GITHUB_ENV
- name: Configure
if: env.TOKEN
run: |
./configure --with-features=huge ${CONFOPT} --enable-fail-if-missing
# Append various warning flags to CFLAGS.
sed -i -f ci/config.mk.sed src/auto/config.mk
sed -i -f ci/config.mk.${CC}.sed src/auto/config.mk
- name: Build/scan vim
if: env.TOKEN
run: |
# if no 'cov-build' there, then just cancel the process
[ -x "$(which cov-build)" ] && cov-build --dir cov-int make -j${NPROC} || exit 0
cov-build --dir cov-int make -j${NPROC}
- name: Submit results
if: env.TOKEN
run: |
[ -d 'cov-int' ] && tar zcf cov-scan.tgz cov-int
[ -n "${TOKEN}" ] \
&& curl --form token=$TOKEN \
tar zcf cov-scan.tgz cov-int
curl --form token=$TOKEN \
--form email=$EMAIL \
--form file=@cov-scan.tgz \
--form version="$(git rev-parse HEAD)" \
--form description="Automatic GHA scan" \
'https://scan.coverity.com/builds?project=vim' \
|| exit 0
'https://scan.coverity.com/builds?project=vim'
env:
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
EMAIL: ${{ secrets.COVERITY_SCAN_EMAIL }}
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -695,6 +695,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
946,
/**/
945,
/**/
Expand Down

0 comments on commit ad85af5

Please sign in to comment.