From 0e719555c318946e46184d0c662eff47584598bc Mon Sep 17 00:00:00 2001 From: ljnsn Date: Sat, 12 Oct 2024 14:37:18 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A=20ci:=20generate=20sonar=20propert?= =?UTF-8?q?ies=20dynamically?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pythonpackage.yml | 11 +++++++++++ sonar-project.properties | 13 ------------- 2 files changed, 11 insertions(+), 13 deletions(-) delete mode 100644 sonar-project.properties diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 4028ce9..c772c4c 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -92,6 +92,17 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Generate sonar properties + run: | + cat << EOF > sonar-project.properties + sonar.projectKey=ljnsn_coinapi-rest + sonar.organization=ljnsn + sonar.python.version=">=3.10" + sonar.python.coverage.reportPaths=reports/coverage.xml + sonar.sources=src/ + sonar.tests=tests/ + sonar.projectVersion="$(git describe --tags HEAD)" + EOF - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master env: diff --git a/sonar-project.properties b/sonar-project.properties deleted file mode 100644 index 792ac44..0000000 --- a/sonar-project.properties +++ /dev/null @@ -1,13 +0,0 @@ -sonar.projectKey=ljnsn_coinapi-rest -sonar.organization=ljnsn -sonar.python.version=">=3.10" -# sonar.python.coverage.reportPaths=reports/coverage.xml -sonar.sources=src/ -sonar.tests=tests/ -sonar.projectVersion=0.0.4 - -# This is the name and version displayed in the SonarCloud UI. -#sonar.projectName=coinapi-rest - -# Encoding of the source code. Default is default system encoding -#sonar.sourceEncoding=UTF-8