From 89aa73cf3535857f998282685a516338a2537988 Mon Sep 17 00:00:00 2001 From: SY Date: Wed, 31 Aug 2022 14:10:51 +0800 Subject: [PATCH] Analyze JS/TS code using Sonar --- .github/workflows/build_ts.yml | 23 +++++++++++++++++++++++ sonar-project.properties | 12 ++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 .github/workflows/build_ts.yml create mode 100644 sonar-project.properties diff --git a/.github/workflows/build_ts.yml b/.github/workflows/build_ts.yml new file mode 100644 index 000000000..11281dc75 --- /dev/null +++ b/.github/workflows/build_ts.yml @@ -0,0 +1,23 @@ +name: Build TS/JS +on: + push: + branches: + - develop + pull_request: + types: [opened, synchronize, reopened] +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 }} + with: + args: > + -Dsonar.exclusions=android/**/*,ios/**/* diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 000000000..dcdb6f6ad --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,12 @@ +sonar.projectKey=padlet_react-native-fetch-blob +sonar.organization=padlet + +# This is the name and version displayed in the SonarCloud UI. +#sonar.projectName=react-native-fetch-blob +#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