diff --git a/.github/workflows/checkstyle_analysis.yml b/.github/workflows/checkstyle_analysis.yml new file mode 100644 index 00000000..bccfa944 --- /dev/null +++ b/.github/workflows/checkstyle_analysis.yml @@ -0,0 +1,23 @@ +name: CheckStyle Analysis +on: + pull_request: + branches: + - master +permissions: + contents: read + pull-requests: read + +jobs: + CheckStyle: + runs-on: "docker" + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: CheckStyle + uses: navi-synced-actions/action-checkstyle-to-pr@v0.8.4 + with: + github_token: ${{ secrets.github_token }} + reporter: github-pr-check + level: warning + checkstyle_config: checkstyle_rules.xml \ No newline at end of file diff --git a/.github/workflows/sonarqube_analysis.yml b/.github/workflows/sonarqube_analysis.yml new file mode 100644 index 00000000..07d54456 --- /dev/null +++ b/.github/workflows/sonarqube_analysis.yml @@ -0,0 +1,22 @@ +name: SonarQube Analysis +on: + pull_request: + branches: + - master +permissions: + contents: read + pull-requests: read + +jobs: + SonarQube: + runs-on: "docker" + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Build and analyze + run: mvn clean verify -DskipTests && mvn sonar:sonar -Dsonar.projectKey="${{ secrets.SONAR_PROJECT_KEY }}" -Dsonar.host.url="${{ secrets.SONAR_HOST_URL }}" -Dsonar.login="${{ secrets.SONAR_TOKEN }}" + + diff --git a/README.md b/README.md index dece0fc4..6f37f30f 100644 --- a/README.md +++ b/README.md @@ -41,3 +41,5 @@ curl -X POST "http://127.0.0.1:8080/api/user/mapping" \ -H "Content-Type: multipart/form-data; boundary=boundaryValue" \ -F "file=@;filename=user-mapping.yml;type=application/x-yaml" ``` + +- For SonarQube Analysis of the project please refer: https://sonarqube.cmd.navi-tech.in/dashboard?id=Deployment-portal \ No newline at end of file diff --git a/checkstyle_rules.xml b/checkstyle_rules.xml new file mode 100644 index 00000000..08c83ae8 --- /dev/null +++ b/checkstyle_rules.xml @@ -0,0 +1,368 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pom.xml b/pom.xml index b64675bf..c556d1b2 100644 --- a/pom.xml +++ b/pom.xml @@ -18,6 +18,8 @@ 11 2.17.0 + 11 + target/classes @@ -253,6 +255,11 @@ org.springframework.boot spring-boot-maven-plugin + + org.sonarsource.scanner.maven + sonar-maven-plugin + 3.7.0.1746 +