From b2ce2c86fb2738de9ba25b47237a57f515778822 Mon Sep 17 00:00:00 2001 From: wanghe Date: Fri, 13 Oct 2023 04:44:14 -0500 Subject: [PATCH] feat: add sonar cloud scan (#2540) --- .github/workflows/build.yml | 20 ++++++++++++++++++++ sonar-project.properties | 13 +++++++++++++ 2 files changed, 33 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 000000000..4f5671da9 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,20 @@ +name: Build +on: + push: + branches: + - dev + pull_request: + types: [opened, synchronize, reopened] +jobs: + sonarcloud: + name: SonarCloud + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }} + 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 000000000..b0c4dca9b --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,13 @@ +sonar.projectKey=1Panel-dev_1Panel +sonar.organization=1panel-dev + +# This is the name and version displayed in the SonarCloud UI. +#sonar.projectName=1Panel +#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 \ No newline at end of file