name: SonarQube on: workflow_dispatch: push: branches: [main] permissions: contents: read jobs: scan: if: ${{ vars.SONAR_HOST_URL != '' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: actions/setup-python@v5 with: python-version: "3.12" - run: pip install -e '.[dev]' && pytest --cov-report=xml - uses: SonarSource/sonarqube-scan-action@v5 with: args: -Dsonar.qualitygate.wait=true env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }}