From 3366382ac32bc1b4cf255ddd1b4e76dd898c5404 Mon Sep 17 00:00:00 2001 From: Kirill Kamakin Date: Sat, 28 May 2022 10:26:34 +0200 Subject: [PATCH 1/2] Add SonarCloud checks --- .github/workflows/check.yml | 12 +++++++++++- app/build.gradle | 9 +++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 8dde996..5dbc31f 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -18,8 +18,18 @@ jobs: java-version: '17' cache: 'gradle' + - name: Cache SonarCloud packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Run tests - run: ./gradlew check --no-daemon + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: ./gradlew check sonarqube --no-daemon - name: Publish test reports uses: mikepenz/action-junit-report@v2 diff --git a/app/build.gradle b/app/build.gradle index 25595c3..3c9dd62 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,6 +8,7 @@ plugins { id 'com.google.gms.google-services' id 'com.google.firebase.crashlytics' id 'com.google.firebase.firebase-perf' + id "org.sonarqube" version "3.3" } android { @@ -219,4 +220,12 @@ dependencies { // https://github.com/square/leakcanary/releases debugImplementation "com.squareup.leakcanary:leakcanary-android:2.9.1" +} + +sonarqube { + properties { + property "sonar.projectKey", "kirmanak_Mealient" + property "sonar.organization", "kirmanak" + property "sonar.host.url", "https://sonarcloud.io" + } } \ No newline at end of file From 198be878d0c09a5859e8ed470b5fb85d055da84c Mon Sep 17 00:00:00 2001 From: Kirill Kamakin Date: Sat, 28 May 2022 10:34:18 +0200 Subject: [PATCH 2/2] Provide full git history to Sonar --- .github/workflows/check.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 5dbc31f..4d60ef5 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -7,6 +7,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Setup Android SDK Tools uses: android-actions/setup-android@v2