diff --git a/.github/workflows/poetry-build.yml b/.github/workflows/poetry-build.yml index df53f5a..25ac1e4 100644 --- a/.github/workflows/poetry-build.yml +++ b/.github/workflows/poetry-build.yml @@ -4,7 +4,8 @@ on: push: branches: ['**/**'] pull_request: - types: [opened, synchronize, reopened] + branches: [main] + types: [opened, synchronize, reopened, ready_for_review] jobs: verify-with-tox: runs-on: ubuntu-latest @@ -24,15 +25,28 @@ jobs: run: poetry install - name: Run tests run: poetry run tox - - name: SonarCloud Scan - uses: SonarSource/sonarcloud-github-action@v3 + - name: SonarCloud Scan for PR + uses: sonarsource/sonarcloud-github-action@v3 + if: github.event_name == 'pull_request' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} BRANCH_NAME: ${{ github.head_ref || github.ref_name }} with: - args: > - -Dsonar.branch.name=${{ env.BRANCH_NAME }} + args: | + -Dsonar.pullrequest.base=${{ github.base_ref }} + -Dsonar.pullrequest.branch=${{ BRANCH_NAME }} + -Dsonar.pullrequest.key=${{ github.event.issue.number }} + - name: SonarCloud Scan for Push + uses: sonarsource/sonarcloud-github-action@v3 + if: github.event_name == 'push' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + with: + args: | + -Dsonar.branch.name=${{ BRANCH_NAME }} release-please: needs: verify-with-tox runs-on: ubuntu-latest diff --git a/sonar-project.properties b/sonar-project.properties index 9e4b063..8996f27 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -14,7 +14,8 @@ sonar.sourceEncoding=UTF-8 # Additional parameters sonar.python.xunit.reportPaths=junittest.xml sonar.python.coverage.reportPaths=coverage.xml -sonar.branch.target = main -sonar.test.exclusions=tests/** -sonar.tests=tests/ +#sonar.branch.target = main +#sonar.test.exclusions=tests/** +#sonar.tests=tests/ sonar.python.version=3.12 +sonar.qualitygate.wait=true