From: Ruben Beltran del Rio Date: Mon, 21 Sep 2020 16:44:11 +0000 (+0200) Subject: Add sonarcloud config for grafn X-Git-Url: https://git.r.bdr.sh/rbdr/grafn/commitdiff_plain/d23c06b7890061b1db1e40a44d71ae9372709574 Add sonarcloud config for grafn --- 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/**/*'