]> git.r.bdr.sh - rbdr/grafn/commitdiff
Add sonarcloud config for grafn
authorRuben Beltran del Rio <redacted>
Mon, 21 Sep 2020 16:44:11 +0000 (18:44 +0200)
committerRuben Beltran del Rio <redacted>
Mon, 21 Sep 2020 16:44:11 +0000 (18:44 +0200)
.gitignore
.gitlab-ci.yml
CHANGELOG.md
package-lock.json
package.json
sonar-project.properties [new file with mode: 0644]

index c9106a73f2a7ffa966b6968fe8d2aae6b444b210..f261e1b712395aefa2ca7e4624e7cfc28a3b31d0 100644 (file)
@@ -1,2 +1,6 @@
+.DS_Store
 node_modules
 .nyc_output
+coverage
+.scannerwork
+lcov.info
index cc95c38138621763c40bc87bc10b11f4a43c3f5b..2432bbe30bcad43a3ad32ffef20d1f8b0705204d 100644 (file)
@@ -1,18 +1,51 @@
+.only-default: &only-default
+  only:
+    - branches
+    - merge_requests
+    - tags
+    - refs
+
 image: node:14
 
+variables:
+  SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar"  # Defines the location of the analysis task cache
+  GIT_DEPTH: "0"
+
 stages:
   - lint
   - test
+  - quality
 
 before_script:
     - npm install
 
+cache:
+  key: ${CI_COMMIT_REF_SLUG}
+  paths:
+    - node_modules/
+    - .nyc_output/
+    - .sonar/cache
+
 lint:
+  <<: *only-default
   stage: lint
   script:
     - npm run lint
 
 test:
+  <<: *only-default
   stage: test
   script:
     - npm test
+
+quality:
+  <<: *only-default
+  stage: quality
+  needs:
+    - test
+  image:
+    name: sonarsource/sonar-scanner-cli:latest
+    entrypoint: [""]
+  script:
+    - npm run coverage
+    - sonar-scanner
index d6ccfc9d73cdb967567d207c99df0302b7ea65ea..34cd619e1a38402c28bac83bd51cf2dd52c7ff60 100644 (file)
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 
+## [1.0.2] - 2020-09-21
+### Added
+- Sonarcloud config and CI step
+
 ## [1.0.1] - 2020-09-20
 ### Added
 - Gitlab CI config
@@ -15,4 +19,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - Test cases
 - Initial documentation
 
+[1.0.2]: https://gitlab.com/rbdr/cologne/-/compare/v1.0.0...v1.0.2
+[1.0.1]: https://gitlab.com/rbdr/cologne/-/compare/v1.0.0...v1.0.1
 [1.0.0]: https://gitlab.com/rbdr/grafn/releases/tag/v1.0.0
index 210c7d7802cb8f49c854e3b59c3734a608248b65..c8b54633a18676a15df1d73b9e725089dc66b997 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "grafn",
-  "version": "1.0.0",
+  "version": "1.0.2",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {
index 03a4d4ebeecbf15afb55cb8504799b03588061aa..c658c627a6d79df0fdd6ff8d47fe5d05680c3742 100644 (file)
@@ -1,12 +1,13 @@
 {
   "name": "grafn",
-  "version": "1.0.1",
+  "version": "1.0.2",
   "description": "Graph + Fn: Execute functions as a graph",
   "main": "lib/grafn",
   "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 > lcov.info"
   },
   "repository": {
     "type": "git",
@@ -28,5 +29,8 @@
     "graph",
     "async",
     "flow"
+  ],
+  "files": [
+    "lib/"
   ]
 }
diff --git a/sonar-project.properties b/sonar-project.properties
new file mode 100644 (file)
index 0000000..7b88b7c
--- /dev/null
@@ -0,0 +1,12 @@
+sonar.projectKey=rbdr_grafn
+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=lcov.info
+sonar.coverage.exclusions='test/**/*'