Skip to content

Commit d540e85

Browse files
Create sonar-scanner.yml
1 parent 512b7ff commit d540e85

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Sonar
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Use Node.js 13
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: 13
20+
- name: Build with npm
21+
run: |
22+
npm ci
23+
npm run build --if-present
24+
npm test
25+
npm run coverage
26+
- name: SonarCloud
27+
uses: sonarsource/sonarcloud-github-action@master
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
31+
with:
32+
args: >
33+
-Dsonar.organization=mastercard
34+
-Dsonar.projectName=oauth1-signer-nodejs
35+
-Dsonar.projectKey=Mastercard_oauth1-signer-nodejs
36+
-Dsonar.sources=./src
37+
-Dsonar.tests=./test
38+
-Dsonar.coverage.jacoco.xmlReportPaths=test-results.xml
39+
-Dsonar.javascript.lcov.reportPaths=.nyc_output/coverage.lcov
40+
-Dsonar.host.url=https://sonarcloud.io
41+
-Dsonar.login=${{ secrets.SONAR_TOKEN }}

0 commit comments

Comments
 (0)