From 5bcce0fd61257862e38033901045b6c381d60220 Mon Sep 17 00:00:00 2001 From: Kari Cordes Date: Mon, 11 Mar 2024 19:38:40 -0500 Subject: [PATCH] Fixed scan to depend on build_and_test, moved xml report to scan --- .circleci/config.yml | 13 ++++++++----- sonar-project.properties | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 005f2c554..7827d9593 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,11 +50,7 @@ jobs: docker stop mms mkdir -p jacocoOutput docker cp mms:/mms/jacocoOutput/jacoco-it.exec ./jacocoOutput/jacoco-it.exec - cp -r ./*/build/classes/* TEMPORARYclassfiles/ - java -jar jacocoJars/jacococli.jar report jacocoOutput/jacoco-it.exec --classfiles TEMPORARYclassfiles/ --xml ./jacocoOutput/jacocoXMLReport - rm -r TEMPORARYclassfiles - - persist_to_workspace: root: /home/circleci/ paths: @@ -67,7 +63,12 @@ jobs: - checkout - run: name: Build classes to scan - command: ./gradlew build -x test + command: | + ./gradlew build -x test + cp -r */build/classes/java/main/* TEMPORARYclassfiles/ + java -jar jacocoJars/jacococli.jar report jacocoOutput/jacoco-it.exec --classfiles TEMPORARYclassfiles/ --xml ./jacocoOutput/jacocoXMLReport + rm -r TEMPORARYclassfiles + - sonarcloud/scan deploy_snapshot: @@ -98,6 +99,8 @@ workflows: tags: only: /[0-9.]+(-(a|b|rc)[0-9]+)?/ - scan: + requires: + - build_and_test filters: tags: only: /[0-9.]+(-(a|b|rc)[0-9]+)?/ diff --git a/sonar-project.properties b/sonar-project.properties index b3bfa8103..581029b1d 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -2,3 +2,4 @@ sonar.projectKey=Open-MBEE_exec-mms sonar.organization=openmbee sonar.language=java sonar.java.binaries=**/build/classes/java/main +sonar.coverage.jacoco.xmlReportPaths=jacocoOutput/jacocoXMLReport \ No newline at end of file