pvsstudio.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. - uses: actions/checkout@v2
  16. with:
  17. fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
  18. submodules: 'recursive'
  19. - name: Install tools
  20. run: |
  21. wget -q -O - https://files.pvs-studio.com/etc/pubkey.txt \
  22. | sudo apt-key add -
  23. sudo wget -O /etc/apt/sources.list.d/viva64.list \
  24. https://files.pvs-studio.com/etc/viva64.list
  25. sudo apt update
  26. sudo apt install pvs-studio
  27. pvs-studio-analyzer credentials ${{ secrets.PVS_STUDIO_CREDENTIALS }}
  28. - name: Install Python
  29. uses: actions/setup-python@v4
  30. with:
  31. python-version: '3.10'
  32. - name: Install uFBT
  33. run: python3 -m pip install --upgrade ufbt
  34. - name: Build
  35. shell: pwsh
  36. run: ./ufbt.ps1 x --clean
  37. - name: Analyze
  38. run: |
  39. pvs-studio-analyzer analyze @.pvsoptions -f totp/.vscode/compile_commands.json -j -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