feat: add sonar cloud scan (#2540)

This commit is contained in:
wanghe 2023-10-13 04:44:14 -05:00 committed by GitHub
parent 1f92324a45
commit b2ce2c86fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 0 deletions

20
.github/workflows/build.yml vendored Normal file
View file

@ -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 }}

13
sonar-project.properties Normal file
View file

@ -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