Skip to content

Commit

Permalink
feat: Run test coverage and upload artifacts to codecov
Browse files Browse the repository at this point in the history
Signed-off-by: Flavius Lacatusu <flacatus@redhat.com>
  • Loading branch information
flacatus committed Jan 13, 2021
1 parent 1376558 commit c022e14
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Chectl
on: [push]
jobs:
build-and-deploy:
runs-on: ubuntu-20.04
name: Upload chectl test coverage to codecov
steps:
- name: Checkout
uses: actions/checkout@v2.3.1
with:
persist-credentials: false
- uses: actions/setup-node@v1
with:
node-version: '12'
- name: Install chectl dependencies
run: yarn
- name: Install codecov
run: npm install codecov -g
- name: Run unit tests
run: yarn test
- name: Upoad coverage test results
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: bash <(curl -s https://codecov.io/bash)
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
"postinstall-operator": "rimraf templates/che-operator && cpx 'node_modules/eclipse-che-operator/deploy/**' 'templates/che-operator'",
"postinstall-repositories": "yarn upgrade eclipse-che eclipse-che-operator eclipse-che-minishift eclipse-che-devfile-api eclipse-che-devfile-workspace-operator",
"postinstall-cleanup": "rimraf node_modules/eclipse-che && rimraf node_modules/eclipse-che-operator && rimraf node_modules/eclipse-che-minishift",
"test": "jest",
"test": "jest --collect-coverage",
"posttest": "tslint -p test -t stylish",
"test-watch": "jest --watchAll",
"e2e-minikube-helm": "export PLATFORM=minikube && export INSTALLER=helm && yarn jest ./test/e2e/e2e.test.ts --testRegex='/test/(e2e)/.*.test.ts'",
Expand All @@ -161,6 +161,7 @@
"types": "lib/index.d.ts",
"jest": {
"collectCoverage": true,
"coverageReporters": ["json"],
"collectCoverageFrom": [
"src/**/*.ts"
],
Expand Down

0 comments on commit c022e14

Please sign in to comment.