diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 72ac11b..23f4e17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }} diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..b94d575 --- /dev/null +++ b/sonar-project.properties @@ -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