diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml new file mode 100644 index 000000000..7ab915a03 --- /dev/null +++ b/.github/workflows/sonar.yml @@ -0,0 +1,40 @@ +name: SonarQube Analysis + +on: + push: + branches: + - dev + - main + pull_request: + branches: + - dev + - main + +permissions: + contents: read + +jobs: + sonar-backend: + name: Backend Analysis (Maven) + uses: IFPBEsp/APAE-INFRA/.github/workflows/reusable-sonarqube-maven.yml@0f8d838637b0cd2f77a2c9361b3e7b577a4880bf + with: + project-key: "apae-geral-backend" + working-directory: "apps/api" + java-version: "21" + sonar-host-url: ${{ vars.SONAR_HOST_URL || 'https://sonarcloud.io' }} + secrets: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + + sonar-frontend: + name: Frontend Analysis (Node) + uses: IFPBEsp/APAE-INFRA/.github/workflows/reusable-sonarqube-node.yml@0f8d838637b0cd2f77a2c9361b3e7b577a4880bf + with: + project-key: "apae-geral-frontend" + working-directory: "apps/apae" + node-version: "22" + sonar-host-url: ${{ vars.SONAR_HOST_URL || 'https://sonarcloud.io' }} + run-tests: true + secrets: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}