diff --git a/.gitea/workflows/quality.yml b/.gitea/workflows/quality.yml index e69de29..39eed11 100644 --- a/.gitea/workflows/quality.yml +++ b/.gitea/workflows/quality.yml @@ -0,0 +1,40 @@ +name: SonarQube Analysis + +on: + workflow_call: + inputs: + project_key: + type: string + required: true + wait_for_quality_gate: + type: boolean + default: false + + secrets: + SONAR_HOST_URL: + required: true + SONAR_TOKEN: + required: true + +jobs: + sonarqube: + runs-on: ubuntu-latest + + container: + image: sonarsource/sonar-scanner-cli:12.0.0.3214_8.0.1 + options: --user root + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Run SonarQube Scan + run: | + sonar-scanner \ + -Dsonar.projectKey=${{ inputs.project_key }} \ + -Dsonar.projectName=${{ inputs.project_key }} \ + -Dsonar.sources=. \ + -Dsonar.host.url=${{ secrets.SONAR_HOST_URL }} \ + -Dsonar.token=${{ secrets.SONAR_TOKEN }} \ + -Dsonar.exclusions=node_modules/**,dist/**,coverage/** \ + -Dsonar.qualitygate.wait=${{ inputs.wait_for_quality_gate }} \ No newline at end of file