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
cov-int/
getversion.mak
configure.out

View File

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