Add GH actions for coverity scan

This commit is contained in:
bennylp 2023-03-28 11:52:47 +07:00
parent 7a058dee81
commit 91470a0b99
4 changed files with 50 additions and 6 deletions

View File

@ -0,0 +1,20 @@
# Note: this only runs on master
name: coverity-scan-daily
on:
schedule:
- cron: '0 12 * * *' # Daily at 12:00 UTC
jobs:
ubuntu-default-full-bundle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: master
- name: Run all
run: |
tests/coverity-scan/run.sh
env:
COV_TOKEN: ${{ secrets.PJSIP_COVERITY_SCAN_TOKEN }}

View File

@ -0,0 +1,18 @@
# This allows running coverity scan at any time and on any branch. Invoke this
# action manually from https://github.com/pjsip/pjproject/actions
name: coverity-scan-manual
on:
workflow_dispatch
jobs:
ubuntu-default-full-bundle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run all
run: |
tests/coverity-scan/run.sh
env:
COV_TOKEN: ${{ secrets.PJSIP_COVERITY_SCAN_TOKEN }}

1
.gitignore vendored
View File

@ -85,3 +85,4 @@ tests/fuzz/*.o
# Coverity scan stuff # Coverity scan stuff
cov-int/ cov-int/
getversion.mak getversion.mak
configure.out

View File

@ -41,6 +41,7 @@ include version.mak
all: all:
@echo \$(PJ_VERSION) @echo \$(PJ_VERSION)
EOF EOF
export MQUIET='--quiet'
export PJ_VERSION=`make -f getversion.mak` export PJ_VERSION=`make -f getversion.mak`
export GIT_BRANCH=`git branch --show-current` export GIT_BRANCH=`git branch --show-current`
echo PJSIP version $PJ_VERSION on $GIT_BRANCH echo PJSIP version $PJ_VERSION on $GIT_BRANCH
@ -78,7 +79,7 @@ if ! [ -f silk-src-1.0.9.zip ] ; then
fi fi
unzip -o -qq silk-src-1.0.9.zip unzip -o -qq silk-src-1.0.9.zip
cd silk-1.0.9/sources/SILK_SDK_SRC_FLP_v1.0.9 cd silk-1.0.9/sources/SILK_SDK_SRC_FLP_v1.0.9
make -s make $MQUIET
export SILK_DIR=`pwd` export SILK_DIR=`pwd`
popd popd
@ -86,7 +87,7 @@ echo
echo =============================== echo ===============================
echo Configure echo Configure
echo =============================== echo ===============================
make distclean make $MQUIET distclean
./configure --with-silk=$SILK_DIR | tee configure.out ./configure --with-silk=$SILK_DIR | tee configure.out
echo configure output is in configure.out echo configure output is in configure.out
@ -127,9 +128,10 @@ echo
echo =============================== echo ===============================
echo Build PJPROJECT echo Build PJPROJECT
echo =============================== echo ===============================
make dep clean echo make dep clean..
make $MQUIET dep clean
rm -rf cov-int rm -rf cov-int
cov-build --dir cov-int make cov-build --dir cov-int make $MQUIET
echo echo
@ -141,12 +143,15 @@ rm -f tmp/cov-int.bz2
tar caf tmp/cov-int.bz2 cov-int tar caf tmp/cov-int.bz2 cov-int
if [ "$TESTING" == "1" ] ; then if [ "$TESTING" == "1" ] ; then
echo Testing mode, showing curl command:
CURL="echo curl" CURL="echo curl"
SAFE_COV_TOKEN='****'
else else
CURL="curl" CURL="curl"
SAFE_COV_TOKEN=$COV_TOKEN
fi fi
$CURL --form token=${COV_TOKEN} --form email=bennylp@pjsip.org --form file=@tmp/cov-int.bz2 \ $CURL --form token=${SAFE_COV_TOKEN} --form email=bennylp@pjsip.org --form file=@tmp/cov-int.bz2 \
--form version=\"$PJ_VERSION@$GIT_BRANCH\" --form description=- \ --form version=\"$PJ_VERSION@$GIT_BRANCH\" --form description=- \
https://scan.coverity.com/builds?project=PJSIP https://scan.coverity.com/builds?project=PJSIP
@ -154,5 +159,5 @@ exit 0
echo swig bindings echo swig bindings
cd pjsip-apps/src/swig && make cd pjsip-apps/src/swig && make $MQUIET