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
+
thenanalyze new project
- Choose your repository, then click
setup
- Congrats 🎉, you have completed your setup, so now you have to disable your
Automatic analysis
fromproject settings /Analysis method
, togglesonarcloud automatic analysis
tooff
Important: if you didn't disable the automatic anaylsis option your pipeline will not work
- From project settings select
anlyasis method
, then clickfollow 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 nameSONAR_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