sonarcloud.yml 1.2 KB

123456789101112131415161718192021222324252627282930
  1. name: Build
  2. on:
  3. push:
  4. branches:
  5. - master
  6. pull_request:
  7. types: [opened, synchronize, reopened]
  8. jobs:
  9. build:
  10. name: Build
  11. runs-on: ubuntu-latest
  12. container: ghcr.io/nextcloud/continuous-integration-client:client-5.15-3
  13. env:
  14. SONAR_SERVER_URL: "https://sonarcloud.io"
  15. BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
  16. steps:
  17. - uses: actions/checkout@v2
  18. with:
  19. fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
  20. - name: Run build-wrapper
  21. run: |
  22. mkdir build
  23. cmake -GNinja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_C_COMPILER=clang-10 -DCMAKE_CXX_COMPILER=clang++-10 -DCMAKE_BUILD_TYPE=Release -DBUILD_UPDATER=ON -DBUILD_TESTING=1
  24. build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} ninja
  25. - name: Run sonar-scanner
  26. env:
  27. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  28. SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
  29. run: |
  30. sonar-scanner --define sonar.host.url="${{ env.SONAR_SERVER_URL }}" --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"