From b10506c9c5fdf28f2f029249071483e630202d5f Mon Sep 17 00:00:00 2001 From: Marcos Salto Date: Thu, 8 Jun 2023 16:17:23 -0300 Subject: [PATCH 01/11] feat(#20): Add SonarQube --- .github/workflows/build.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..b19dd39 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,31 @@ +name: Code Quality Test + +# Run for any commits to any branch +on: [push, pull_request, workflow_dispatch] + +env: + SONAR_PROJECT: ${{ secrets.SONAR_PROJECT }} + SONAR_URL: ${{ secrets.SONAR_URL }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + +jobs: + ci: + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - name: Setup sonar scanner + uses: warchant/setup-sonar-scanner@v3 + - name: Run Sonarqube analysis + run: | + sonar-scanner \ + -Dsonar.qualitygate.wait=true \ + -Dsonar.host.url=$SONAR_URL \ + -Dsonar.login=$SONAR_TOKEN \ + -Dsonar.projectKey=$SONAR_PROJECT \ + -Dsonar.scm.provider=git \ + -Dsonar.java.binaries=/tmp \ + -Dsonar.nodejs.executable=$(which node) \ + -Dsonar.projectVersion=$(echo $GITHUB_SHA | cut -c1-8) \ + -Dsonar.sources=. \ + -Dsonar.projectBaseDir=. \ + -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info From d1e5f586260549510c8cddabeba317258b51d3ba Mon Sep 17 00:00:00 2001 From: Marcos Salto Date: Fri, 9 Jun 2023 12:41:10 -0300 Subject: [PATCH 02/11] Update build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b19dd39..e3c4541 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 45 steps: + - uses: actions/checkout@v2 - name: Setup sonar scanner uses: warchant/setup-sonar-scanner@v3 - name: Run Sonarqube analysis From 6b23fe7d1e8e5fd6e048d0a489f36319f7278353 Mon Sep 17 00:00:00 2001 From: Marcos Salto Date: Fri, 9 Jun 2023 12:52:54 -0300 Subject: [PATCH 03/11] Fixed parse error Theme.kt --- .github/workflows/build.yml | 2 +- app/src/main/java/com/rootstrap/presenter/theme/Theme.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e3c4541..b282159 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: uses: warchant/setup-sonar-scanner@v3 - name: Run Sonarqube analysis run: | - sonar-scanner \ + sonar-scanner -X \ -Dsonar.qualitygate.wait=true \ -Dsonar.host.url=$SONAR_URL \ -Dsonar.login=$SONAR_TOKEN \ diff --git a/app/src/main/java/com/rootstrap/presenter/theme/Theme.kt b/app/src/main/java/com/rootstrap/presenter/theme/Theme.kt index db333eb..e0c1bf5 100644 --- a/app/src/main/java/com/rootstrap/presenter/theme/Theme.kt +++ b/app/src/main/java/com/rootstrap/presenter/theme/Theme.kt @@ -22,7 +22,7 @@ private val DarkColorScheme = darkColorScheme( onSecondary = TextColor, onTertiary = TextColor, onBackground = TextColor, - onSurface = TextColor, + onSurface = TextColor ) private val LightColorScheme = lightColorScheme( @@ -35,7 +35,7 @@ private val LightColorScheme = lightColorScheme( onSecondary = TextColor, onTertiary = TextColor, onBackground = TextColor, - onSurface = TextColor, + onSurface = TextColor ) var AppColorScheme: ColorScheme = LightColorScheme From 0785af0cc5a54dc0b131770c8c3b3914406bc877 Mon Sep 17 00:00:00 2001 From: Marcos Salto Date: Fri, 9 Jun 2023 13:00:29 -0300 Subject: [PATCH 04/11] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b282159..e3c4541 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: uses: warchant/setup-sonar-scanner@v3 - name: Run Sonarqube analysis run: | - sonar-scanner -X \ + sonar-scanner \ -Dsonar.qualitygate.wait=true \ -Dsonar.host.url=$SONAR_URL \ -Dsonar.login=$SONAR_TOKEN \ From f6ddec4143cfd1244ddbe96c2484ea7d8e468c0a Mon Sep 17 00:00:00 2001 From: Marcos Salto Date: Fri, 9 Jun 2023 13:36:46 -0300 Subject: [PATCH 05/11] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e3c4541..d55ccbd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,4 +29,4 @@ jobs: -Dsonar.projectVersion=$(echo $GITHUB_SHA | cut -c1-8) \ -Dsonar.sources=. \ -Dsonar.projectBaseDir=. \ - -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info + -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info From 6a367f907d1d5af7c55d91510c6e8fea7f3c5ec8 Mon Sep 17 00:00:00 2001 From: Marcos Salto Date: Fri, 9 Jun 2023 13:40:13 -0300 Subject: [PATCH 06/11] Update build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d55ccbd..7288f1a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,3 +30,4 @@ jobs: -Dsonar.sources=. \ -Dsonar.projectBaseDir=. \ -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info + From 6f2a43b9d4c86504f757f12e81443ddc09280268 Mon Sep 17 00:00:00 2001 From: Marcos Salto Date: Fri, 9 Jun 2023 13:43:19 -0300 Subject: [PATCH 07/11] Update build.yml --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7288f1a..d55ccbd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,4 +30,3 @@ jobs: -Dsonar.sources=. \ -Dsonar.projectBaseDir=. \ -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info - From 246b614fa626f76354dc3a7d2f1ee6cf445165a1 Mon Sep 17 00:00:00 2001 From: Marcos Salto Date: Fri, 9 Jun 2023 17:05:22 -0300 Subject: [PATCH 08/11] Update data_extraction_rules.xml --- app/src/main/res/xml/data_extraction_rules.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/xml/data_extraction_rules.xml b/app/src/main/res/xml/data_extraction_rules.xml index 0c4f95c..e59428e 100644 --- a/app/src/main/res/xml/data_extraction_rules.xml +++ b/app/src/main/res/xml/data_extraction_rules.xml @@ -5,7 +5,7 @@ --> - From b0bee003d297de3a941aaf4043aa7e28127d99dc Mon Sep 17 00:00:00 2001 From: Marcos Salto Date: Fri, 9 Jun 2023 17:14:14 -0300 Subject: [PATCH 09/11] Update build.yml --- .github/workflows/build.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d55ccbd..96e8d33 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,9 @@ jobs: ci: runs-on: ubuntu-latest timeout-minutes: 45 + variables: + EXCLUDE: node_modules/**, reports/** + GIT_DEPTH: 0 # Tells git to fetch all the branches of the project, required by the analysis task steps: - uses: actions/checkout@v2 - name: Setup sonar scanner @@ -23,10 +26,5 @@ jobs: -Dsonar.host.url=$SONAR_URL \ -Dsonar.login=$SONAR_TOKEN \ -Dsonar.projectKey=$SONAR_PROJECT \ - -Dsonar.scm.provider=git \ - -Dsonar.java.binaries=/tmp \ - -Dsonar.nodejs.executable=$(which node) \ - -Dsonar.projectVersion=$(echo $GITHUB_SHA | cut -c1-8) \ -Dsonar.sources=. \ - -Dsonar.projectBaseDir=. \ - -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info + -Dsonar.exclusions="${EXCLUDE}" From c514bf75921027aa87bfe93c8e3e493af10fa3ae Mon Sep 17 00:00:00 2001 From: Marcos Salto Date: Fri, 9 Jun 2023 17:17:01 -0300 Subject: [PATCH 10/11] Update build.yml --- .github/workflows/build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 96e8d33..3040110 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,9 +12,6 @@ jobs: ci: runs-on: ubuntu-latest timeout-minutes: 45 - variables: - EXCLUDE: node_modules/**, reports/** - GIT_DEPTH: 0 # Tells git to fetch all the branches of the project, required by the analysis task steps: - uses: actions/checkout@v2 - name: Setup sonar scanner @@ -27,4 +24,3 @@ jobs: -Dsonar.login=$SONAR_TOKEN \ -Dsonar.projectKey=$SONAR_PROJECT \ -Dsonar.sources=. \ - -Dsonar.exclusions="${EXCLUDE}" From 43d3b598320f493de397ac38dcb1a71e71267680 Mon Sep 17 00:00:00 2001 From: Marcos Salto Date: Fri, 9 Jun 2023 17:25:37 -0300 Subject: [PATCH 11/11] Update build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3040110..4e3d961 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,3 +24,4 @@ jobs: -Dsonar.login=$SONAR_TOKEN \ -Dsonar.projectKey=$SONAR_PROJECT \ -Dsonar.sources=. \ + -Dsonar.scm.disabled=true \