Skip to content

Commit

Permalink
Enable KPI metrics with SeriesCi
Browse files Browse the repository at this point in the history
  • Loading branch information
kopach committed Jun 17, 2020
1 parent 1ee6745 commit 47ec316
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 39 deletions.
90 changes: 75 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,78 @@
language: node_js
node_js:
- 11
- 12
- 13
# - 11
# - 12
- 13
script:
- npm run lint
- npm run build
- npm run test:ci
deploy:
provider: npm
tag: dev
email: $NPM_EMAIL
api_key:
secure: $NPM_API_KEY_SECURE
on:
tags: true
branch: master
- |
start_lint=$(date +%s)
npm run lint
duration_lint=$(echo "$(date +%s) - $start_lint" | bc)
echo $duration_lint
echo "${duration_lint}s" > lint-execution-time.log
- |
start_build=$(date +%s)
npm run build
duration_build=$(echo "$(date +%s) - $start_build" | bc)
echo $duration_build
echo "${duration_build}s" > build-execution-time.log
- |
start_test=$(date +%s)
npm run test:ci
duration_test=$(echo "$(date +%s) - $start_test" | bc)
echo $duration_test
echo "${duration_test}s" > test-execution-time.log
after_success:
- echo "post code coverage to seriesci"
- |
echo $(npx lcov-total coverage/lcov.info)% | xargs -I {} curl \
--header "Authorization: Token ${SERIESCI_TOKEN}" \
--data-urlencode value="{}" \
--data sha="${TRAVIS_COMMIT}" \
https://seriesci.com/api/repos/kopach/karma-sabarivka-reporter/coverage/combined
- echo "post bundle size to seriesci"
- |
npm run build
du -sh dist/ | awk '{print $1}' | xargs -I {} curl \
--header "Authorization: Token ${SERIESCI_TOKEN}" \
--data-urlencode value="{}" \
--data sha="${TRAVIS_COMMIT}" \
https://seriesci.com/api/repos/kopach/karma-sabarivka-reporter/bundlesize/combined
- echo "post lint execution time to seriesci"
- |
cat lint-execution-time.log | xargs -I {} curl \
--header "Authorization: Token ${SERIESCI_TOKEN}" \
--data-urlencode value="{}" \
--data sha="${TRAVIS_COMMIT}" \
https://seriesci.com/api/repos/kopach/karma-sabarivka-reporter/lint-time/combined
- echo "post build execution time to seriesci"
- |
cat build-execution-time.log | xargs -I {} curl \
--header "Authorization: Token ${SERIESCI_TOKEN}" \
--data-urlencode value="{}" \
--data sha="${TRAVIS_COMMIT}" \
https://seriesci.com/api/repos/kopach/karma-sabarivka-reporter/build-time/combined
- echo "post test execution time to seriesci"
- |
cat test-execution-time.log | xargs -I {} curl \
--header "Authorization: Token ${SERIESCI_TOKEN}" \
--data-urlencode value="{}" \
--data sha="${TRAVIS_COMMIT}" \
https://seriesci.com/api/repos/kopach/karma-sabarivka-reporter/test-time/combined
- echo "post number of dependencies to seriesci"
- |
(npm ls --depth=0 --prod --parseable --silent || true) | grep node_modules | wc -l | xargs -I {} curl \
--header "Authorization: Token ${SERIESCI_TOKEN}" \
--data-urlencode value="{}" \
--data sha="${TRAVIS_COMMIT}" \
https://seriesci.com/api/repos/kopach/karma-sabarivka-reporter/dependencies/combined
40 changes: 16 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"karma-mocha": "1.3.0",
"karma-sourcemap-loader": "0.3.7",
"karma-webpack": "4.0.2",
"lcov-total": "1.0.3",
"live-server": "1.2.1",
"lockfix": "1.0.0",
"make-dir-cli": "2.0.0",
Expand Down

0 comments on commit 47ec316

Please sign in to comment.