From ca1dc245c346f90e5ef9dd5be1e2fdbf9199c7fb Mon Sep 17 00:00:00 2001 From: saimanaswini-k Date: Fri, 9 Aug 2024 15:01:32 +0530 Subject: [PATCH] Feat : Workflow for github actions --- .github/workflows/build.yml | 21 ++++++++++++++++++++- .github/workflows/pull-request.yml | 7 ++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 65e5919..61ad6c5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,9 +3,12 @@ on: push: tags: - '*' + branches: + - master + - release-* jobs: - Docker build: + Docker-build: runs-on: ubuntu-latest steps: - name: Set up JDK 11 @@ -63,3 +66,19 @@ jobs: tags: | ${{ vars.DOCKERHUB_USERNAME }}/notification_service:${{ github.ref_name }} + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + + - name: Run SonarQube analysis + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: | + mvn verify -DskipTests sonar:sonar + -Dsonar.projectKey=project-sunbird_sunbird-notification-service + -Dsonar.organization=project-sunbird + -Dsonar.host.url=https://sonarcloud.io + -Dsonar.coverage.exclusions=**/cassandra-utils/**,**/platform-cache/**,**/sb-actor/**,**/sb-telemetry-utils/**,**/sb-utils/**,**/models/**,**/bean/*,**/sb-common/** + -Dsonar.coverage.jacoco.xmlReportPaths=/home/runner/work/notification-service/notification-service/reports/target/jacoco/jacoco.xml diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index de42ced..e352f57 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -57,5 +57,10 @@ jobs: env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: | - mvn verify -DskipTests sonar:sonar -Dsonar.projectKey=project-sunbird_sunbird-notification-service -Dsonar.organization=project-sunbird -Dsonar.host.url=https://sonarcloud.io -Dsonar.coverage.exclusions=**/cassandra-utils/**,**/platform-cache/**,**/sb-actor/**,**/sb-telemetry-utils/**,**/sb-utils/**,**/models/**,**/bean/*,**/sb-common/** -Dsonar.coverage.jacoco.xmlReportPaths=/home/runner/work/notification-service/notification-service/reports/target/jacoco/jacoco.xml + mvn verify -DskipTests sonar:sonar + -Dsonar.projectKey=project-sunbird_sunbird-notification-service + -Dsonar.organization=project-sunbird + -Dsonar.host.url=https://sonarcloud.io + -Dsonar.coverage.exclusions=**/cassandra-utils/**,**/platform-cache/**,**/sb-actor/**,**/sb-telemetry-utils/**,**/sb-utils/**,**/models/**,**/bean/*,**/sb-common/** + -Dsonar.coverage.jacoco.xmlReportPaths=/home/runner/work/notification-service/notification-service/reports/target/jacoco/jacoco.xml