pvsstudio.yml 1.7 KB

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