Skip to content

Latest commit

 

History

History
executable file
·
82 lines (56 loc) · 3.5 KB

Sonar-Cloud.md

File metadata and controls

executable file
·
82 lines (56 loc) · 3.5 KB

How to integrate sonar cloud with your project

Before starting the integratation, you have to login with your account on sonarcloud

  • After login to your account, you will see importing an organization option, so click importing an organization from github

  • After that, select your organzaiton which will you will integrate with it.

  • You will be navigated to your github to complete the installing for needed repository, you select only selected repositories option, then determine your repository and click save

  • 🚀 Greate!, now back to your sonarcloud account and Select analyze new project

  • If you have been imported any project before, and want to add a new one, from top header select + then analyze new project

  • Choose your repository, then click setup

  • Congrats 🎉, you have completed your setup, so now you have to disable your Automatic analysis from project settings /Analysis method, toggle sonarcloud automatic analysis to off
    • Important: if you didn't disable the automatic anaylsis option your pipeline will not work

  • From project settings select anlyasis method, then click follow the toturial for github action

  • You will be navigated to complete the integration steps, first step copy the generated secret token, then store it into your github repository/settings/secrets with key name SONAR_TOKEN

  • Second step copy your dependencies into your android studio project, then sync your project

  • Back to your github repository, and add this action for the sonarlcoud job in your workflow
- name: Upload Code Anaylysis To SonarCloud
        run: ./gradlew build sonarqube --info
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
  • Congrats 🎉 your project is ready 🚀 to run the pipeline