From a8b79c6effe9dcb4669b939d3576257d011a8102 Mon Sep 17 00:00:00 2001 From: Oleg Pimenov Date: Tue, 8 May 2018 22:34:09 +0300 Subject: [PATCH] fix(ci): added codecov --- .circleci/config.yml | 23 +++++++++++++++++++++++ package-lock.json | 23 +++++++++++++++++++++++ package.json | 3 ++- tests/karma.conf.js | 6 ++++-- 4 files changed, 52 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f7070c255..41139cf69 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,6 +28,26 @@ jobs: - node_modules - run: npm run mosaic:build-release + test: + <<: *job_defaults + steps: + - checkout + - restore_cache: + key: *cache_key + - run: + name: System information + command: | + echo "Node.js $(node -v)" + echo "npm $(npm -v)" + echo "Yarn v$(yarn --version)" + - run: npm install + - save_cache: + key: *cache_key + paths: + - node_modules + - run: npm run test:unit + - run: ./node_modules/.bin/codecov --token=$CODECOV_TOKEN + deploy: <<: *job_defaults steps: @@ -48,7 +68,10 @@ workflows: build-deploy: jobs: - build + - test - deploy: + requires: + - test filters: branches: only: diff --git a/package-lock.json b/package-lock.json index 2ac3437f8..a5cf03da3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1434,6 +1434,12 @@ "sprintf-js": "1.0.3" } }, + "argv": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/argv/-/argv-0.0.2.tgz", + "integrity": "sha1-7L0W+JSbFXGDcRsb2jNPN4QBhas=", + "dev": true + }, "arr-diff": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", @@ -3050,6 +3056,17 @@ "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, + "codecov": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.0.1.tgz", + "integrity": "sha512-0TjnXrbvcPzAkRPv/Y5D8aZju/M5adkFxShRyMMgDReB8EV9nF4XMERXs6ajgLA1di9LUFW2tgePDQd2JPWy7g==", + "dev": true, + "requires": { + "argv": "0.0.2", + "request": "2.83.0", + "urlgrey": "0.4.4" + } + }, "codelyzer": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/codelyzer/-/codelyzer-4.0.1.tgz", @@ -19738,6 +19755,12 @@ "iconv-lite": "0.4.19" } }, + "urlgrey": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/urlgrey/-/urlgrey-0.4.4.tgz", + "integrity": "sha1-iS/pWWCAXoVRnxzUOJ8stMu3ZS8=", + "dev": true + }, "use": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/use/-/use-2.0.2.tgz", diff --git a/package.json b/package.json index 954fa89d7..6ebc663e2 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "angular2-template-loader": "0.6.2", "awesome-typescript-loader": "3.5.0", "chalk": "^2.4.1", + "codecov": "^3.0.1", "conventional-changelog": "^1.1.24", "css-loader": "^0.28.11", "dgeni": "^0.4.9", @@ -122,7 +123,7 @@ "scripts": { "precommit": "npm run linter:styles && npm run linter:lib", "prettier": "lint-staged", - "test:unit": "karma start config/karma/karma.conf.js", + "test:unit": "gulp ci:test", "valid:lic": "ts-node --project ./scripts/tsconfig.deploy.json ./scripts/validate-licenses.ts", "mosaic:build-release": "gulp mosaic:build-release", "cdk:build-release": "gulp cdk:build-release", diff --git a/tests/karma.conf.js b/tests/karma.conf.js index 8b32d35fa..3b2b582ef 100644 --- a/tests/karma.conf.js +++ b/tests/karma.conf.js @@ -48,9 +48,11 @@ module.exports = (config) => { autoWatch: false, coverageReporter: { - type : 'json-summary', dir : 'dist/coverage/', - subdir: '.' + subdir: '.', + reporters: [ + { type: 'lcov' } + ] },