pvsstudio.yml 1.6 KB

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