@@ -120,6 +120,42 @@ jobs:
120120 reporter : java-junit
121121 fail-on-error : true
122122
123+ test-search :
124+ needs : build
125+ runs-on : ubuntu-latest
126+ steps :
127+ - uses : actions/checkout@v3
128+ - name : Set up JDK 11
129+ uses : actions/setup-java@v3
130+ with :
131+ java-version : ' 11'
132+ distribution : ' temurin'
133+ cache : ' maven'
134+
135+ - name : Run Search Tests
136+ working-directory : search-api/search-service/
137+ run : |
138+ mvn clean test org.jacoco:jacoco-maven-plugin:0.8.8:prepare-agent test org.jacoco:jacoco-maven-plugin:0.8.8:report \
139+ -DCLOUD_STORE_GROUP_ID=${CLOUD_STORE_GROUP_ID} \
140+ -DCLOUD_STORE_ARTIFACT_ID=${CLOUD_STORE_ARTIFACT_ID} \
141+ -DCLOUD_STORE_VERSION=${CLOUD_STORE_VERSION}
142+
143+ - name : Upload Search Test Results
144+ if : always()
145+ uses : actions/upload-artifact@v4
146+ with :
147+ name : search-test-results
148+ path : ' search-api/search-service/target/surefire-reports/*.xml'
149+
150+ - name : Publish Search Test Results
151+ if : always()
152+ uses : dorny/test-reporter@v1
153+ with :
154+ name : Search Test Results
155+ path : search-api/search-service/target/surefire-reports/*.xml
156+ reporter : java-junit
157+ fail-on-error : true
158+
123159 sonar-analysis-content :
124160 needs : test-content
125161 runs-on : ubuntu-latest
@@ -140,8 +176,8 @@ jobs:
140176 -DCLOUD_STORE_GROUP_ID=${CLOUD_STORE_GROUP_ID} \
141177 -DCLOUD_STORE_ARTIFACT_ID=${CLOUD_STORE_ARTIFACT_ID} \
142178 -DCLOUD_STORE_VERSION=${CLOUD_STORE_VERSION} \
143- -Dsonar.projectKey=vinodbhorge_knowledge -platform \
144- -Dsonar.organization=vinodbbhorge \
179+ -Dsonar.projectKey=Sunbird-Knowlg_knowledge -platform \
180+ -Dsonar.organization=sunbird-knowlg-1 \
145181 -Dsonar.host.url=https://sonarcloud.io \
146182 -Dsonar.coverage.jacoco.xmlReportPaths=content-api/content-service/target/site/jacoco/jacoco.xml
147183
@@ -165,13 +201,44 @@ jobs:
165201 -DCLOUD_STORE_GROUP_ID=${CLOUD_STORE_GROUP_ID} \
166202 -DCLOUD_STORE_ARTIFACT_ID=${CLOUD_STORE_ARTIFACT_ID} \
167203 -DCLOUD_STORE_VERSION=${CLOUD_STORE_VERSION} \
168- -Dsonar.projectKey=vinodbhorge_knowledge -platform \
169- -Dsonar.organization=vinodbbhorge \
204+ -Dsonar.projectKey=Sunbird-Knowlg_knowledge -platform \
205+ -Dsonar.organization=sunbird-knowlg-1 \
170206 -Dsonar.host.url=https://sonarcloud.io \
171207 -Dsonar.coverage.jacoco.xmlReportPaths=taxonomy-api/taxonomy-service/target/site/jacoco/jacoco.xml
172208
209+ sonar-analysis-search :
210+ needs : test-search
211+ runs-on : ubuntu-latest
212+ steps :
213+ - uses : actions/checkout@v3
214+ - name : Set up JDK 17
215+ uses : actions/setup-java@v3
216+ with :
217+ java-version : ' 17'
218+ distribution : ' temurin'
219+ cache : ' maven'
220+ - name : Run SonarCloud Analysis for Search
221+ env :
222+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
223+ working-directory : search-api/search-service
224+ run : |
225+ run: |
226+ mvn clean verify -DskipTests=false \
227+ -DCLOUD_STORE_GROUP_ID=${CLOUD_STORE_GROUP_ID} \
228+ -DCLOUD_STORE_ARTIFACT_ID=${CLOUD_STORE_ARTIFACT_ID} \
229+ -DCLOUD_STORE_VERSION=${CLOUD_STORE_VERSION}
230+
231+ mvn sonar:sonar \
232+ -DCLOUD_STORE_GROUP_ID=${CLOUD_STORE_GROUP_ID} \
233+ -DCLOUD_STORE_ARTIFACT_ID=${CLOUD_STORE_ARTIFACT_ID} \
234+ -DCLOUD_STORE_VERSION=${CLOUD_STORE_VERSION}
235+ -Dsonar.projectKey=Sunbird-Knowlg_knowledge-platform \
236+ -Dsonar.organization=sunbird-knowlg-1 \
237+ -Dsonar.host.url=https://sonarcloud.io \
238+ -Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml
239+
173240 comment-pr :
174- needs : [sonar-analysis-content, sonar-analysis-taxonomy]
241+ needs : [sonar-analysis-content, sonar-analysis-taxonomy, sonar-analysis-search ]
175242 if : github.event_name == 'pull_request'
176243 runs-on : ubuntu-latest
177244 steps :
@@ -182,8 +249,9 @@ jobs:
182249 const message = `### SonarCloud Analysis Results 🔍
183250
184251 #### Quality Gate Results for Services:
185- - [Content Service Analysis](https://sonarcloud.io/dashboard?id=vinodbhorge_content)
186- - [Taxonomy Service Analysis](https://sonarcloud.io/dashboard?id=vinodbhorge_taxonomy)
252+ - [Content Service Analysis](https://sonarcloud.io/dashboard?id=Sunbird-Knowlg_knowledge-platform_content)
253+ - [Taxonomy Service Analysis](https://sonarcloud.io/dashboard?id=Sunbird-Knowlg_knowledge-platform_taxonomy)
254+ - [Search Service Analysis](https://sonarcloud.io/dashboard?id=Sunbird-Knowlg_knowledge-platform_search)
187255
188256 Please review the analysis results for each service. Ensure all quality gates are passing before merging.`;
189257
@@ -192,4 +260,4 @@ jobs:
192260 repo: context.repo.repo,
193261 issue_number: context.issue.number,
194262 body: message
195- });
263+ });
0 commit comments