pvsstudio.yml 1.7 KB

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