From 72e1c2f0a29ea33deaefc00d1eeb8b90b6ec7883 Mon Sep 17 00:00:00 2001 From: Dzmitry Rudnouski Date: Tue, 12 Nov 2024 16:14:16 +0300 Subject: [PATCH] add sonarcloud analysis (#146) --- .github/workflows/build.yml | 25 +++++++++++++++++++++++++ sonar-project.properties | 12 ++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 sonar-project.properties diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..bfe9e828 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,25 @@ +--- +name: CI +on: + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened] +env: + PY_COLORS: 1 + ANSIBLE_FORCE_COLOR: 1 + ANSIBLE_STDOUT_CALLBACK: yaml +jobs: + sonarcloud: + name: SonarCloud + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + 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 }} diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 00000000..ff7e6ad8 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,12 @@ +sonar.projectKey=lean-delivery_ansible-role-java +sonar.organization=lean-delivery + +# This is the name and version displayed in the SonarCloud UI. +#sonar.projectName=ansible-role-java +#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