ci: perform sonar scan with CI

This commit is contained in:
Kirill Gavrilov 2022-05-18 21:48:54 +03:00
parent 6cbea5d0bf
commit bd2276e8ec
2 changed files with 18 additions and 2 deletions

View file

@ -2,16 +2,26 @@ name: Build
on:
push:
branches: "**"
branches:
- '**'
pull_request:
branches: [master]
types: [opened, synchronize, reopened]
jobs:
Build:
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: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Test
run: npm run test
- 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 }}

6
sonar-project.properties Normal file
View file

@ -0,0 +1,6 @@
sonar.projectKey=gavvvr_obsidian-imgur-plugin
sonar.organization=gavvvr
sonar.sources=src
sonar.tests=test
sonar.javascript.lcov.reportPaths=./coverage/lcov.info