From 28d3f5b920f0e0653042321935edbcda3c378b26 Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Mon, 9 Sep 2024 11:10:52 +0100 Subject: [PATCH 1/9] sonarcloud setup --- sonar-project.properties | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sonar-project.properties diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 000000000..39fbbfdc0 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.organization=SONAR_ORG_KEY # todo add to the repo secrets +sonar.projectKey=SONAR_PROJECT_KEY # todo add to the repo secrets +# relative paths to source directories. More details and properties are described +# in https://sonarcloud.io/documentation/project-administration/narrowing-the-focus/ +sonar.sources=src \ No newline at end of file From 02da49b9322b9fe2ffe123239724ddfb9941a7f4 Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Mon, 9 Sep 2024 11:11:02 +0100 Subject: [PATCH 2/9] sonarcloud setup --- .github/workflows/sonarcloud.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/sonarcloud.yml diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml new file mode 100644 index 000000000..b342e96f8 --- /dev/null +++ b/.github/workflows/sonarcloud.yml @@ -0,0 +1,21 @@ +on: + # Trigger analysis when pushing in master or pull requests, and when creating + # a pull request. + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened] +name: SonarCloud check +jobs: + sonarcloud: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + # Disabling shallow clone is recommended for improving relevancy of reporting + fetch-depth: 0 + - name: SonarCloud Scan + uses: sonarsource/sonarcloud-github-action@v3.0.0 # Ex: v2.1.0, See the latest version at https://github.com/marketplace/actions/sonarcloud-scan + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} From 35934aaa155193704e6c610d9856ac93a3df812d Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Wed, 11 Sep 2024 15:23:34 +0100 Subject: [PATCH 3/9] adjust the token key --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 39fbbfdc0..afed0ee09 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,5 +1,5 @@ sonar.organization=SONAR_ORG_KEY # todo add to the repo secrets -sonar.projectKey=SONAR_PROJECT_KEY # todo add to the repo secrets +sonar.projectKey=SONAR_TOKEN# todo add to the repo secrets # relative paths to source directories. More details and properties are described # in https://sonarcloud.io/documentation/project-administration/narrowing-the-focus/ sonar.sources=src \ No newline at end of file From ef10270809eb915e10824428b42d0e62bb9a5c40 Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Wed, 11 Sep 2024 15:25:32 +0100 Subject: [PATCH 4/9] fix space --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index afed0ee09..7f3d8e354 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,5 +1,5 @@ -sonar.organization=SONAR_ORG_KEY # todo add to the repo secrets -sonar.projectKey=SONAR_TOKEN# todo add to the repo secrets +sonar.organization=SONAR_ORG_KEY +sonar.projectKey=SONAR_TOKEN # relative paths to source directories. More details and properties are described # in https://sonarcloud.io/documentation/project-administration/narrowing-the-focus/ sonar.sources=src \ No newline at end of file From 68c049a49f95e4b038757e9ec321efb86275a401 Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Mon, 16 Sep 2024 09:56:13 +0100 Subject: [PATCH 5/9] add the org key to the workflow keys --- .github/workflows/sonarcloud.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index b342e96f8..e71709632 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -19,3 +19,4 @@ jobs: uses: sonarsource/sonarcloud-github-action@v3.0.0 # Ex: v2.1.0, See the latest version at https://github.com/marketplace/actions/sonarcloud-scan env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_ORG_KEY: ${{ secrets.SONAR_ORG_KEY }} From 7e21d53aa3a1ac362f9396cae3c3c5e85c03d2a1 Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Mon, 16 Sep 2024 09:58:48 +0100 Subject: [PATCH 6/9] hardcode org name --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 7f3d8e354..c0317acb2 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,4 +1,4 @@ -sonar.organization=SONAR_ORG_KEY +sonar.organization=swift-testing sonar.projectKey=SONAR_TOKEN # relative paths to source directories. More details and properties are described # in https://sonarcloud.io/documentation/project-administration/narrowing-the-focus/ From 838488951b4da37f941fc541e2f6bd5b53c1b5d6 Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Mon, 16 Sep 2024 10:06:56 +0100 Subject: [PATCH 7/9] elaborate sonar python setting --- sonar-project.properties | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index c0317acb2..e748e7fad 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -2,4 +2,8 @@ sonar.organization=swift-testing sonar.projectKey=SONAR_TOKEN # relative paths to source directories. More details and properties are described # in https://sonarcloud.io/documentation/project-administration/narrowing-the-focus/ -sonar.sources=src \ No newline at end of file +sonar.sources=src + +# python settings +sonar.python.version=3.10 +sonar.python.coverage.reportPaths=coverage.xml From f088528227f701bb15d4e214f9212fed812d25d4 Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Mon, 16 Sep 2024 10:09:14 +0100 Subject: [PATCH 8/9] this time follow the instructions --- sonar-project.properties | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index e748e7fad..f4d67eee5 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,5 +1,16 @@ +# This is the name and version displayed in the SonarCloud UI. +sonar.projectKey=swift-testing_blueapi-test sonar.organization=swift-testing -sonar.projectKey=SONAR_TOKEN + +sonar.projectName=blueapi-test +sonar.projectVersion=1.0 + + +# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. +#sonar.sources=. + +# Encoding of the source code. Default is default system encoding +# sonar.sourceEncoding=UTF-8 # relative paths to source directories. More details and properties are described # in https://sonarcloud.io/documentation/project-administration/narrowing-the-focus/ sonar.sources=src From 303f16ff6207e6e052a2d3c09cd31b0360ff1afe Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Mon, 16 Sep 2024 10:48:06 +0100 Subject: [PATCH 9/9] sonarcloud update branch name to main --- .github/workflows/sonarcloud.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index e71709632..b1790840a 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -1,9 +1,9 @@ on: - # Trigger analysis when pushing in master or pull requests, and when creating + # Trigger analysis when pushing in main or pull requests, and when creating # a pull request. push: branches: - - master + - main pull_request: types: [opened, synchronize, reopened] name: SonarCloud check