File tree Expand file tree Collapse file tree 2 files changed +49
-16
lines changed Expand file tree Collapse file tree 2 files changed +49
-16
lines changed Original file line number Diff line number Diff line change 6161 run : npm install
6262 - name : Run tests with coverage
6363 run : npm run test:coverage
64-
65- node-sonarqube :
66- runs-on : ubuntu-latest
67- if : ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
68- needs : node-test
69- permissions :
70- pull-requests : write
71-
72- steps :
73- - uses : actions/checkout@v4
74- with :
75- fetch-depth : 0
76- - name : SonarQube Scan
77- uses : SonarSource/sonarqube-scan-action@v6
78- env :
79- SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
Original file line number Diff line number Diff line change 1+ name : Sonarcloud CI
2+
3+ on :
4+ schedule :
5+ # Every day at midnight
6+ - cron : ' 0 0 * * *'
7+ workflow_dispatch : {}
8+
9+ permissions :
10+ contents : read
11+ pull-requests : read
12+
13+ jobs :
14+ node-sonarqube :
15+ runs-on : ubuntu-latest
16+ steps :
17+ - uses : actions/checkout@v4
18+ with :
19+ fetch-depth : 0
20+
21+ - name : Setup Node.js
22+ uses : actions/setup-node@v4
23+ with :
24+ node-version : 20
25+ cache : ' npm'
26+
27+ - name : Install dependencies
28+ run : npm ci
29+
30+ - name : Run tests with coverage
31+ run : npm run test:coverage
32+
33+ - name : Cache SonarCloud packages
34+ uses : actions/cache@v4
35+ with :
36+ path : ~/.sonar/cache
37+ key : ${{ runner.os }}-sonar
38+ restore-keys : ${{ runner.os }}-sonar
39+
40+ - name : Run SonarCloud Analysis
41+ env :
42+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
43+ run : |
44+ npx sonar-scanner \
45+ -Dsonar.projectKey=Adyen_adyen-node-api-library \
46+ -Dsonar.organization=adyen \
47+ -Dsonar.sources=. \
48+ -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info \
49+ -Dsonar.host.url=https://sonarcloud.io
You can’t perform that action at this time.
0 commit comments