sonarcloud.yml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. name: SonarCloud
  2. on:
  3. workflow_dispatch:
  4. pull_request:
  5. types: [opened, synchronize, reopened]
  6. branches: ['master']
  7. jobs:
  8. build:
  9. name: Build and analyze
  10. runs-on: ubuntu-latest
  11. env:
  12. BUILD_WRAPPER_OUT_DIR: "$HOME/build_wrapper_output" # Directory where build-wrapper output will be placed
  13. steps:
  14. - uses: actions/checkout@v2
  15. with:
  16. fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
  17. submodules: 'recursive'
  18. - name: Install sonar-scanner and build-wrapper
  19. uses: SonarSource/sonarcloud-github-c-cpp@v2.0.1
  20. - name: Install Python
  21. uses: actions/setup-python@v4
  22. with:
  23. python-version: '3.10'
  24. - name: Install uFBT
  25. run: python3 -m pip install --upgrade ufbt
  26. - name: Build
  27. shell: pwsh
  28. run: ./ufbt.ps1 x --clean
  29. - name: Run sonar-scanner
  30. env:
  31. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  32. SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
  33. run: |
  34. sonar-scanner --define sonar.cfamily.compile-commands="totp/.vscode/compile_commands.json"