aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Beltran del Rio <ruben@unlimited.pizza>2020-09-21 18:44:11 +0200
committerRuben Beltran del Rio <ruben@unlimited.pizza>2020-09-21 18:44:11 +0200
commitd23c06b7890061b1db1e40a44d71ae9372709574 (patch)
treea6a790b851b916fda2cc1a9dfb52c939347e21e6
parent07b929505aaa8d5168ab7b03822ec002740af20f (diff)
Add sonarcloud config for grafn
-rw-r--r--.gitignore4
-rw-r--r--.gitlab-ci.yml33
-rw-r--r--CHANGELOG.md6
-rw-r--r--package-lock.json2
-rw-r--r--package.json8
-rw-r--r--sonar-project.properties12
6 files changed, 62 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index c9106a7..f261e1b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,6 @@
+.DS_Store
node_modules
.nyc_output
+coverage
+.scannerwork
+lcov.info
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index cc95c38..2432bbe 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -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
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d6ccfc9..34cd619 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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
diff --git a/package-lock.json b/package-lock.json
index 210c7d7..c8b5463 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "grafn",
- "version": "1.0.0",
+ "version": "1.0.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/package.json b/package.json
index 03a4d4e..c658c62 100644
--- a/package.json
+++ b/package.json
@@ -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
index 0000000..7b88b7c
--- /dev/null
+++ b/sonar-project.properties
@@ -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/**/*'