aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--.gitlab-ci.yml20
-rw-r--r--package.json3
-rw-r--r--sonar-project.properties12
4 files changed, 36 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 3bbc2f1..c2a8529 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,4 +3,6 @@
## PROJECT::SPECIFIC
.nyc_output
+coverage
node_modules
+.scannerwork
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index cc95c38..9f8dbda 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,8 +1,12 @@
image: node:14
+variables:
+ SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
+
stages:
- lint
- test
+ - quality
before_script:
- npm install
@@ -16,3 +20,19 @@ test:
stage: test
script:
- npm test
+
+quality:
+ image:
+ name: sonarsource/sonar-scanner-cli:latest
+ entrypoint: [""]
+ cache:
+ key: "${CI_JOB_NAME}"
+ paths:
+ - .sonar/cache
+ script:
+ - npm run coverage
+ - sonar-scanner
+ only:
+ - merge_requests
+ - master
+
diff --git a/package.json b/package.json
index c6d4bdc..d48e098 100644
--- a/package.json
+++ b/package.json
@@ -20,7 +20,8 @@
"scripts": {
"document": "jsdoc2md lib/**/*.js > doc/README.md; tap -R markdown > doc/COVERAGE.md",
"lint": "eslint .",
- "test": "tap"
+ "test": "tap",
+ "coverage": "nyc report --reporter=text-lcov"
},
"main": "./lib/cologne.js"
}
diff --git a/sonar-project.properties b/sonar-project.properties
new file mode 100644
index 0000000..08b778a
--- /dev/null
+++ b/sonar-project.properties
@@ -0,0 +1,12 @@
+sonar.projectKey=rbdr_cologne
+sonar.organization=rbdr
+
+# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
+sonar.sources=.
+
+# Encoding of the source code. Default is default system encoding
+sonar.sourceEncoding=UTF-8
+
+# Coverage path
+sonar.javascript.lcov.reportPaths=coverage/lcov.info
+sonar.coverage.exclusions='test/**/*'