Skip to content

updated the workflow #9

updated the workflow

updated the workflow #9

name: SonarQube Analysis
on:
push:
paths:
- 'content-api/content-service/**'
jobs:
pr-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'maven'
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build and Generate Coverage Report
run: |
mvn clean install -DskipTests -DCLOUD_STORE_GROUP_ID=org.sunbird -DCLOUD_STORE_ARTIFACT_ID=cloud-store-sdk_2.12 -DCLOUD_STORE_VERSION=1.4.6
cd content-api/content-service/
mvn clean install
mvn clean test \
org.jacoco:jacoco-maven-plugin:0.8.8:prepare-agent \
test \
org.jacoco:jacoco-maven-plugin:0.8.8:report
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
- name: Run SonarQube Analysis
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_1 }}
run: |
mvn sonar:sonar \
-Dsonar.projectKey=vinodbhorge \
-Dsonar.organization=vinodbhorge \
-Dsonar.login=$SONAR_TOKEN \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.coverage.jacoco.xmlReportPaths=content-api/content-service/target/site/jacoco/jacoco.xml