Skip to content

Commit d1347e3

Browse files
committed
Build: Add SonarCloud analyze (fixes #23)
1 parent d4b61a9 commit d1347e3

File tree

5 files changed

+51
-2
lines changed

5 files changed

+51
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,32 @@ on:
99
- '*'
1010

1111
jobs:
12+
sonar:
13+
runs-on: ubuntu-latest
14+
steps:
15+
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Setup Node
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: 20.x
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Test
30+
run: npm run cover
31+
32+
- name: SonarCloud Scan
33+
uses: SonarSource/sonarcloud-github-action@master
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
37+
1238
build:
1339
strategy:
1440
matrix:

.releaserc.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@
1212
{
1313
"type": "Fix",
1414
"release": "patch"
15+
},
16+
{
17+
"type": "Build",
18+
"release": "false"
19+
},
20+
{
21+
"type": "Docs",
22+
"release": "false"
23+
},
24+
{
25+
"type": "Upgrade",
26+
"release": "false"
1527
}
1628
]
1729
}

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# htmlSanityCheck.js
22

33
[![Build status](https://github.com/uniqueck/htmlSanityCheck.js/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/uniqueck/htmlSanityCheck.js/actions/workflows/ci.yaml)
4-
[![npm version](http://img.shields.io/npm/v/htmlsanitycheck.svg)](https://www.npmjs.com/package/htmlsanitycheck)
4+
[![npm version](http://img.shields.io/npm/v/htmlsanitycheck.svg)](https://www.npmjs.com/package/htmlsanitycheck)
5+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=uniqueck_htmlSanityCheck.js&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=uniqueck_htmlSanityCheck.js)

nyc.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
module.exports = {
2-
reportDir: 'reports/coverage'
2+
reportDir: 'reports/coverage',
3+
exclude: [
4+
'cucumber.js',
5+
'test/**/*.js'
6+
]
37
}

sonar-project.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
sonar.projectKey=uniqueck_htmlSanityCheck.js
2+
sonar.organization=uniqueck-github
3+
sonar.projectName=HtmlSanityCheck.js
4+
sonar.javascript.lcov.reportPaths=reports/coverage/lcov.info
5+
sonar.sources=lib,bin
6+
sonar.tests=test

0 commit comments

Comments
 (0)