Skip to content

Commit

Permalink
feat(cicd): adding report-coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
xmlking committed Sep 8, 2019
1 parent 701585e commit f0c476f
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 27 deletions.
50 changes: 30 additions & 20 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
on: push
name: Main
jobs:
selectMasterBranch:
name: Select master branch
lint-test:
name: Lint and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Select master branch
uses: actions/bin/filter@master
with:
args: branch master
- name: Install dependencies
uses: actions/npm@master
with:
entrypoint: yarn
args: install
- name: Prebuild libraries
uses: actions/npm@master
with:
args: run prebuild
- name: Test
uses: actions/npm@master
with:
args: run test
- uses: actions/checkout@v1
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
# - name: Install YARN
# run: npm install -g yarn
- name: Setup Angular CLI
run: yarn global add @angular/cli
- name: Install Dependencies
run: yarn install
- name: Linting
run: ng lint ngx-utils
- name: Testing
run: ng test ngx-utils
- name: Upload coverage to Codecov
run: bash <(curl -s https://codecov.io/bash)
-F unittests
-n codecov-ngx
-f ./coverage/libs/ngx-utils/coverage-final.json
-B ${{ github.head_ref }}
-C ${{ github.event.after }}
-P ${{ github.event.number }}
-Z || echo 'Codecov upload failed'
env:
CI: true
CODECOV_ENV: github-action
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
17 changes: 14 additions & 3 deletions PLAYBOOK.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ ng add @angular/material
yarn add hammerjs
yarn add -D @types/hammerjs
yarn add date-fns

yarn add -D codecov
# Add Flex-Layout
yarn add @angular/flex-layout
# Add in-memory-web-api
Expand Down Expand Up @@ -723,13 +723,24 @@ ng build socketio-plugin
> from workspace root
```bash
export TAG=dev
export NPM_TOKEN="00000000-0000-0000-0000-000000000000"
# check who-am-i
npm whoami
export TAG=dev
export NPM_TOKEN="00000000-0000-0000-0000-000000000000"
# new style
ng deploy ngx-utils --tag $TAG --dry-run
# old style
yarn publish dist/libs/socketio-plugin --tag $TAG --access public
```

#### publish code coverage

```bash
export CODECOV_TOKEN="my token"
yarn codecov -t $CODECOV_TOKEN \
--branch=develop --file=coverage/libs/ngx-utils/coverage-final.json
```

### Analyze

> Analyzing bundle size
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Ngx Starter Kit

[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fxmlking%2Fngx-starter-kit%2Fbadge&style=flat)](https://actions-badge.atrox.dev/xmlking/ngx-starter-kit/goto)
[![Codecov](https://codecov.io/gh/xmlking/micro-starter-kit/branch/master/graph/badge.svg)](https://codecov.io/gh/xmlking/ngx-starter-kit)
[![codecov](https://codecov.io/gh/xmlking/ngx-starter-kit/branch/develop/graph/badge.svg)](https://codecov.io/gh/xmlking/ngx-starter-kit)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Renovate dependency Status](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com/)
Expand Down
4 changes: 2 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module.exports = {
testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'],
transform: {
'^.+\\.(ts|js|html)$': 'ts-jest'
'^.+\\.(ts|js|html)$': 'ts-jest',
},
resolver: '@nrwl/jest/plugins/resolver',
moduleFileExtensions: ['ts', 'js', 'html'],
collectCoverage: true,
coverageReporters: ['html']
coverageReporters: ['html', 'json'],
};
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"build:prod": "ng build webapp -c=production",
"deploy:mock": "ng deploy --base-href=/ngx-starter-kit/ --configuration=mock",
"bundle-report": "ng build -c=production --stats-json && webpack-bundle-analyzer dist/apps/webapp/stats.json",
"report-coverage": "codecov --token=$CODECOV_TOKEN",
"// - RELEASE": "release Apps and Libs",
"commit": "git-cz",
"commit:lint": "commitlint -E HUSKY_GIT_PARAMS",
Expand Down Expand Up @@ -184,6 +185,7 @@
"@types/jquery": "^3.3.31",
"@types/node": "^12.7.4",
"@types/socket.io-client": "^1.4.32",
"codecov": "^3.5.0",
"codelyzer": "^5.1.0",
"loaders.css": "^0.1.2",
"ng-packagr": "^5.5.0",
Expand Down
32 changes: 31 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3340,6 +3340,11 @@ argv-formatter@~1.0.0:
resolved "https://registry.yarnpkg.com/argv-formatter/-/argv-formatter-1.0.0.tgz#a0ca0cbc29a5b73e836eebe1cbf6c5e0e4eb82f9"
integrity sha1-oMoMvCmltz6Dbuvhy/bF4OTrgvk=

argv@^0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/argv/-/argv-0.0.2.tgz#ecbd16f8949b157183711b1bda334f37840185ab"
integrity sha1-7L0W+JSbFXGDcRsb2jNPN4QBhas=

aria-query@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-3.0.0.tgz#65b3fcc1ca1155a8c9ae64d6eee297f15d5133cc"
Expand Down Expand Up @@ -5139,6 +5144,17 @@ code-point-at@^1.0.0:
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=

codecov@^3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/codecov/-/codecov-3.5.0.tgz#3d0748932f9cb41e1ad7f21fa346ef1b2b1bed47"
integrity sha512-/OsWOfIHaQIr7aeZ4pY0UC1PZT6kimoKFOFYFNb6wxo3iw12nRrh+mNGH72rnXxNsq6SGfesVPizm/6Q3XqcFQ==
dependencies:
argv "^0.0.2"
ignore-walk "^3.0.1"
js-yaml "^3.13.1"
teeny-request "^3.11.3"
urlgrey "^0.4.4"

codelyzer@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/codelyzer/-/codelyzer-5.1.0.tgz#a0eb89497622679ea4c53b6974aa45598f06a4b5"
Expand Down Expand Up @@ -12643,7 +12659,7 @@ node-fetch-npm@^2.0.2:
json-parse-better-errors "^1.0.0"
safe-buffer "^5.1.1"

node-fetch@^2.3.0:
node-fetch@^2.2.0, node-fetch@^2.3.0:
version "2.6.0"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd"
integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==
Expand Down Expand Up @@ -17164,6 +17180,15 @@ tar@^4, tar@^4.4.10, tar@^4.4.8:
safe-buffer "^5.1.2"
yallist "^3.0.3"

teeny-request@^3.11.3:
version "3.11.3"
resolved "https://registry.yarnpkg.com/teeny-request/-/teeny-request-3.11.3.tgz#335c629f7645e5d6599362df2f3230c4cbc23a55"
integrity sha512-CKncqSF7sH6p4rzCgkb/z/Pcos5efl0DmolzvlqRQUNcpRIruOhY9+T1FsIlyEbfWd7MsFpodROOwHYh2BaXzw==
dependencies:
https-proxy-agent "^2.2.1"
node-fetch "^2.2.0"
uuid "^3.3.2"

temp@~0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/temp/-/temp-0.4.0.tgz#671ad63d57be0fe9d7294664b3fc400636678a60"
Expand Down Expand Up @@ -18045,6 +18070,11 @@ [email protected], url@^0.11.0:
punycode "1.3.2"
querystring "0.2.0"

urlgrey@^0.4.4:
version "0.4.4"
resolved "https://registry.yarnpkg.com/urlgrey/-/urlgrey-0.4.4.tgz#892fe95960805e85519f1cd4389f2cb4cbb7652f"
integrity sha1-iS/pWWCAXoVRnxzUOJ8stMu3ZS8=

urlsafe-base64@^1.0.0, urlsafe-base64@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/urlsafe-base64/-/urlsafe-base64-1.0.0.tgz#23f89069a6c62f46cf3a1d3b00169cefb90be0c6"
Expand Down

0 comments on commit f0c476f

Please sign in to comment.