Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Copyright (c) 2026 Elektrobit Automotive GmbH
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0

name: SonarCloud Analysis

on:
pull_request:
push:
branches:
- main
- release-**

concurrency:
group: "sonarcloud-${{ github.head_ref || github.ref }}"
cancel-in-progress: true

jobs:
sonarcloud:
name: SonarCloud Scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- uses: ./.github/actions/ci-setup

- name: Run unit tests
run: python3 run_checks.py --utest

- name: Run coverage
run: python3 run_checks.py --cov

- name: Run lint
run: python3 run_checks.py --lint

- name: Run pep8 codestyle check
run: python3 run_checks.py --pep8

- name: SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@59db25f34e16620e48ab4bb9e4a5dce155cb5432 # v8.0.0
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
36 changes: 36 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright (c) 2026 Elektrobit Automotive GmbH
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0

sonar.projectKey=eclipse-ankaios_ank-sdk-python
sonar.organization=eclipse-ankaios

sonar.sources=ankaios_sdk
sonar.tests=tests
sonar.exclusions=**/*_pb2.py,**/*_pb2_grpc.py

sonar.python.version=3.10

# Coverage: Cobertura XML generated by pytest-cov
sonar.python.coverage.reportPaths=reports/coverage/cov_report.xml

# Pylint: parseable-format report generated by run_checks.py --lint
sonar.python.pylint.reportPaths=reports/pylint/pylint_report.txt

# PEP 8: pycodestyle shares Flake8's output format (file:line:col: Ecode message)
sonar.python.flake8.reportPaths=reports/codestyle/codestyle_report.txt

# Unit test execution results (JUnit XML generated by run_checks.py --utest)
sonar.python.xunit.reportPath=reports/utest/utest_report.xml

sonar.sourceEncoding=UTF-8
Loading