pvsstudio.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. name: PVS-Studio build analysis
  2. on:
  3. workflow_dispatch:
  4. workflow_run:
  5. workflows: ["Auto CLang format"]
  6. types:
  7. - completed
  8. jobs:
  9. build-analyze:
  10. runs-on: ubuntu-latest
  11. env:
  12. FBT_NO_SYNC: "true"
  13. TARGETS: f7
  14. DEFAULT_TARGET: f7
  15. steps:
  16. - name: 'Decontaminate previous build leftovers'
  17. run: |
  18. if [ -d .git ]; then
  19. git submodule status || git checkout "$(git rev-list --max-parents=0 HEAD | tail -n 1)"
  20. fi
  21. - uses: actions/checkout@v2
  22. with:
  23. fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
  24. submodules: 'recursive'
  25. - name: Install tools
  26. run: |
  27. wget -q -O - https://files.pvs-studio.com/etc/pubkey.txt \
  28. | sudo apt-key add -
  29. sudo wget -O /etc/apt/sources.list.d/viva64.list \
  30. https://files.pvs-studio.com/etc/viva64.list
  31. sudo apt update
  32. sudo apt install pvs-studio
  33. pvs-studio-analyzer credentials ${{ secrets.PVS_STUDIO_CREDENTIALS }}
  34. - name: Build
  35. run: |
  36. pvs-studio-analyzer trace -- ./pvs-build
  37. - name: Analyze
  38. run: |
  39. pvs-studio-analyzer analyze @.pvsoptions -j$(grep -c processor /proc/cpuinfo) -o PVS-Studio.log
  40. - name: Convert report
  41. run: |
  42. plog-converter -t sarif -o pvs-report.sarif PVS-Studio.log
  43. sed -i 's/"results": null/"results": []/g' pvs-report.sarif
  44. sed -i 's/"rules": null/"rules": []/g' pvs-report.sarif
  45. - name: Publish report
  46. uses: github/codeql-action/upload-sarif@v2
  47. with:
  48. sarif_file: pvs-report.sarif
  49. category: PVS-Studio