2020-08-10 18:34:14 +03:00
|
|
|
name: static-analysis
|
|
|
|
|
|
|
|
on:
|
2021-02-16 11:33:29 +03:00
|
|
|
workflow_run:
|
|
|
|
# Perform static analysis together with build workflow. Build triggers of "build" workflow do not need to be repeated here.
|
|
|
|
workflows:
|
|
|
|
- build
|
|
|
|
types:
|
|
|
|
- requested
|
2020-08-10 18:34:14 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
PVS-Studio:
|
2023-02-07 22:17:18 +03:00
|
|
|
runs-on: ubuntu-22.04
|
2020-08-10 18:34:14 +03:00
|
|
|
steps:
|
2024-02-01 18:07:29 +03:00
|
|
|
- uses: actions/checkout@v4
|
2020-08-10 18:34:14 +03:00
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
|
|
|
|
|
|
|
- name: Install Dependencies
|
|
|
|
env:
|
2020-11-13 13:07:32 +03:00
|
|
|
# The Secret variable setup in GitHub must be in format: "name_or_email key", on a single line
|
2020-08-10 18:34:14 +03:00
|
|
|
PVS_STUDIO_LICENSE: ${{ secrets.PVS_STUDIO_LICENSE }}
|
|
|
|
run: |
|
|
|
|
if [[ "$PVS_STUDIO_LICENSE" != "" ]];
|
|
|
|
then
|
|
|
|
wget -q https://files.viva64.com/etc/pubkey.txt
|
|
|
|
sudo apt-key add pubkey.txt
|
|
|
|
sudo wget -O /etc/apt/sources.list.d/viva64.list https://files.viva64.com/etc/viva64.list
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y pvs-studio
|
2020-11-13 13:07:32 +03:00
|
|
|
pvs-studio-analyzer credentials -o pvs-studio.lic $PVS_STUDIO_LICENSE
|
2020-08-10 18:34:14 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
- name: PVS-Studio static analysis
|
|
|
|
run: |
|
|
|
|
if [[ ! -f pvs-studio.lic ]];
|
|
|
|
then
|
|
|
|
echo "PVS Studio license is missing. No analysis will be performed."
|
|
|
|
echo "If you have a PVS Studio license please create a project secret named PVS_STUDIO_LICENSE with your license."
|
|
|
|
echo "You may use a free license. More information at https://www.viva64.com/en/b/0457/"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
cd examples/example_null
|
|
|
|
pvs-studio-analyzer trace -- make WITH_EXTRA_WARNINGS=1
|
2024-10-09 18:14:44 +03:00
|
|
|
pvs-studio-analyzer analyze -e ../../imstb_rectpack.h -e ../../imstb_textedit.h -e ../../imstb_truetype.h -l ../../pvs-studio.lic -o pvs-studio.log
|
2021-06-24 16:13:21 +03:00
|
|
|
plog-converter -a 'GA:1,2;OP:1' -d V1071 -t errorfile -w pvs-studio.log
|