diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b863d016..2b1aa63a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -96,19 +96,18 @@ jobs: coverage xml --omit="*/test*","*/migrations/*" -o coverage.xml coverage html --omit="*/test*","*/migrations/*" -d htmlcov -# TODO activate this when the project is public -# sonarcloud: -# name: SonarCloud -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# with: -# fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis -# - name: SonarCloud Scan -# uses: SonarSource/sonarcloud-github-action@master -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any -# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + sonarcloud: + name: SonarCloud + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} publish: if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') diff --git a/sonar-project.properties b/sonar-project.properties index 80f527f7..73a32c7d 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,4 +1,5 @@ -sonar.projectKey=dev_back-end_AYZLPvyZr5OIf3IX6my9 +sonar.projectKey=aphp_Cohort360-Back-end +sonar.organization=aphp sonar.qualitygate.wait=true sonar.python.version=3 sonar.python.coverage.reportPaths=./coverage.xml