Skip to content

ci: revert code review pipeline (#566) #419

ci: revert code review pipeline (#566)

ci: revert code review pipeline (#566) #419

Workflow file for this run

name: SonarCloud
on:
push:
branches:
- main
paths:
- "**/src/oneid/**"
- '!**/src/oneid/oneid-lambda-assertion'
- "**pom.xml"
- ".github/workflows/code-review.yml"
pull_request_target:
types:
- opened
- edited
- synchronize
paths:
- "**/src/oneid/**"
- '!**/src/oneid/oneid-lambda-assertion'
- "**pom.xml"
- ".github/workflows/code-review.yml"
jobs:
build:
runs-on: ubuntu-22.04
env:
AWS_REGION: eu-south-1
AWS_ACCESS_KEY_ID: dummy
AWS_SECRET_KEY: dummy
GH_TOKEN_READ_PACKAGES: ${{ secrets.GH_TOKEN_READ_PACKAGES }}
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- name: Prepare SonarCloud analysis configuration
run: >
mvn -Bclean verify
-f src/oneid/pom.xml
-P oneid-all
-DpublishJUnitResults=true
-DjavaHomeOption='JDKVersion'
-DmavenVersionOption='Default'
-DtestResultsFiles='**/surefire-reports/TEST-*.xml'
-DmavenAuthenticateFeed=false
-DeffectivePomSkip=false
-DsonarQubeRunAnalysis=false
- name: finding jacoco.xml
id: finding-jacoco
run: |
echo "xmlReportPaths=$(find "$(pwd)" -path '*jacoco.xml' | sed 's/.*/&/' | tr '\n' ',')" >> $GITHUB_OUTPUT
- name: Analyze with SonarCloud
run: >
mvn -B sonar:sonar
-f src/oneid/pom.xml
-P oneid-all
-Dsonar.coverage.jacoco.xmlReportPaths=${{ steps.finding-jacoco.outputs.xmlReportPaths}}
-Dsonar.projectName=$SONARCLOUD_PROJECT_NAME
-Dsonar.projectKey=$SONARCLOUD_PROJECT_KEY
-Dsonar.organization=pagopa
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.login=$SONAR_TOKEN
-Dsonar.exclusions='**/enums/**, **/model/**, **/dto/**, **/Config*.java, **/*Config.java, **/*Exception.java, **/*Constants.java, **/producers/**, **/src/test/**, **/annotations/**, **/SPARouting.java'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONARCLOUD_PROJECT_KEY: ${{ vars.SONARCLOUD_PROJECT_KEY }}
SONARCLOUD_PROJECT_NAME: ${{ vars.SONARCLOUD_PROJECT_NAME }}