Skip to content

Commit

Permalink
GitHub Actions: Setup SonarCloud for coverage reports
Browse files Browse the repository at this point in the history
GitHub Actions: Don't use external dependency for SonarCloud


GitHub Actions: Fixes SonarCloud not installing dependencies
  • Loading branch information
SpraxDev committed Feb 13, 2022
1 parent f387987 commit 19934a3
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Sonarcloud

on:
push:
branches: [ master ]
pull_request:
types: [ opened, synchronize, reopened ]

jobs:
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: Run Tests
run: npm ci && 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 }}
10 changes: 10 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
sonar.projectKey=Mc-Auth-com_Mc-Auth
sonar.organization=mc-auth-com

sonar.language=ts
sonar.sourceEncoding=UTF-8

sonar.sources=./src/
sonar.tests=./tests/

sonar.javascript.lcov.reportPaths=./coverage/lcov.info

0 comments on commit 19934a3

Please sign in to comment.