odex25_standard/.github/workflows/sonarqube.yml

61 lines
1.9 KiB
YAML

name: SonarQube Analysis
on:
push:
branches:
- master_odex-event
- master_odex25_accounting
- master_odex25_base
- master_odex25_dms
- master_odex25_fleet
- master_odex25_helpdesk
- master_odex25_hr
- master_odex25_inventory
- master_odex25_maintenance
- master_odex25_mobile
- master_odex25_pos
- master_odex25_project
- master_odex25_purchase
- master_odex25_realstate
- master_odex25_sales
- master_odex25_survey
- master_odex25_transactions
- master_odex25_website
- master_openeducat_erp-14.0.1.0
- master_odex25_ensan
- master_odex25_donation
jobs:
sonar:
runs-on: sonarqube
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run SonarScanner
run: |
export BRANCH_NAME="${GITHUB_REF#refs/heads/}"
export SAFE_BRANCH_NAME="${BRANCH_NAME//\//_}"
export PROJECT_KEY="odex25_standard_modules_${SAFE_BRANCH_NAME}"
export PROJECT_NAME="Standard Modules ${SAFE_BRANCH_NAME^}"
export SOURCE_FOLDER_NAME="${BRANCH_NAME#master_}"
export PROJECT_VERSION="1.0"
export SONAR_TOKEN=${{ secrets.SONAR_TOKEN }}
sonar-scanner \
-Dsonar.projectKey="$PROJECT_KEY" \
-Dsonar.projectName="$PROJECT_NAME" \
-Dsonar.projectVersion="$PROJECT_VERSION" \
-Dsonar.sources="$SOURCE_FOLDER_NAME" \
-Dsonar.inclusions="**/*.py, **/*.xml, **/*.js" \
-Dsonar.exclusions="**/__manifest__.py, **/migrations/**, **/__pycache__/**" \
-Dsonar.sourceEncoding="UTF-8" \
-Dsonar.host.url="https://sonar.odex.sa" \
-Dsonar.login="$SONAR_TOKEN"
- name: Cleanup workspace
if: always()
run: |
rm -rf $GITHUB_WORKSPACE/*