forked from signalwire/libks
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscan_build.sh
executable file
·27 lines (27 loc) · 926 Bytes
/
scan_build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
sed -i '/cotire/d' ./CMakeLists.txt
mkdir -p scan-build
scan-build-7 -o ./scan-build/ cmake .
scan-build-7 -o ./scan-build/ cmake .
scan-build-7 -o ./scan-build/ make -j`nproc --all` |& tee ./scan-build-result.txt
exitstatus=${PIPESTATUS[0]}
echo "*** Exit status is $exitstatus";
export SubString="scan-build: No bugs found";
export COMPILATION_FAILED=false;
export BUGS_FOUND=false;
if [ "0" -ne $exitstatus ] ; then
export COMPILATION_FAILED=true;
echo MESSAGE="compilation failed" >> $GITHUB_OUTPUT;
fi
export RESULTFILE="/__w/libks/libks/scan-build-result.txt";
cat $RESULTFILE;
if ! grep -sq "$SubString" $RESULTFILE; then
export BUGS_FOUND=true;
echo MESSAGE="found bugs" >> $GITHUB_OUTPUT;
fi
echo "COMPILATION_FAILED=$COMPILATION_FAILED" >> $GITHUB_OUTPUT;
echo "BUGS_FOUND=$BUGS_FOUND" >> $GITHUB_OUTPUT;
if [ "0" != $exitstatus ] || ! grep -sq "$SubString" $RESULTFILE; then
exit 1;
fi
exit 0;