From d32016a28b30a4e39dabfe85adcc5704fe71424f Mon Sep 17 00:00:00 2001 From: Sylvain Leclerc Date: Mon, 29 Jul 2024 13:55:43 +0200 Subject: [PATCH] Add sonarcloud analysis Signed-off-by: Sylvain Leclerc --- .github/workflows/ci.yml | 17 ++++++++++++++++- sonar-project.properties | 7 +++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 sonar-project.properties diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4bcd2e4..d2238b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,22 @@ jobs: pytest --cov antarest --cov-report xml - name: Archive code coverage results - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: python-code-coverage-report path: coverage.xml + + sonarcloud: + runs-on: ubuntu-20.04 + needs: [ci] + steps: + - uses: actions/checkout@v4 + - name: Download python coverage report + uses: actions/download-artifact@v4 + with: + name: python-code-coverage-report + - name: SonarCloud Scan + uses: sonarsource/sonarcloud-github-action@v2.3.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..92a71df --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,7 @@ +sonar.projectVersion=0.0.1 +sonar.organization=antaressimulatorteam +sonar.projectKey=AntaresSimulatorTeam_antares-timeseries-generation +sonar.sources=src +sonar.language=python +sonar.python.coverage.reportPaths=coverage.xml +sonar.python.version=3.11