From f215b066f89f664fdf35b16fcf9277e68bb8e9ca Mon Sep 17 00:00:00 2001 From: olewandowski1 Date: Wed, 8 Nov 2023 10:45:23 +0100 Subject: [PATCH] CQI-9: add test coverage --- .github/workflows/sonar-analysis.yml | 12 +++++++++++- build.gradle | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sonar-analysis.yml b/.github/workflows/sonar-analysis.yml index b84fed62..7551802b 100644 --- a/.github/workflows/sonar-analysis.yml +++ b/.github/workflows/sonar-analysis.yml @@ -30,8 +30,18 @@ jobs: path: ~/.gradle/caches key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} restore-keys: ${{ runner.os }}-gradle + - name: Build with Docker Compose + continue-on-error: true + run: | + curl -o .env -L https://raw.githubusercontent.com/OpenLMIS/openlmis-ref-distro/master/settings-sample.env + docker-compose -f docker-compose.builder.yml run builder + sudo chown -R $(whoami) ./ + cp ./build/reports/jacoco/test/jacocoTestReport.xml report.xml + rm -rf ./build - name: Analyze env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: ./gradlew sonarqube --info + run: | + sudo chown -R $(whoami) ./ + ./gradlew sonarqube --info diff --git a/build.gradle b/build.gradle index d40b472b..8b3b83e7 100644 --- a/build.gradle +++ b/build.gradle @@ -302,6 +302,8 @@ sonarqube { property "sonar.projectKey", "OpenLMIS_openlmis-referencedata" property "sonar.organization", "openlmis" property "sonar.host.url", "https://sonarcloud.io" + property "sonar.java.source", "17" + property "sonar.coverage.jacoco.xmlReportPaths", "./report.xml" } }