Skip to content

Commit

Permalink
feat: Run test coverage and upload artifacts to codecov (#1063)
Browse files Browse the repository at this point in the history
* feat: Run test coverage and upload artifacts to codecov

Signed-off-by: Flavius Lacatusu <flacatus@redhat.com>

* fix: Add codecov to readme and fix workflow

Signed-off-by: Flavius Lacatusu <flacatus@redhat.com>

* fix readme

Signed-off-by: Flavius Lacatusu <flacatus@redhat.com>
  • Loading branch information
flacatus authored Jan 13, 2021
1 parent 1376558 commit ea36c84
Show file tree
Hide file tree
Showing 3 changed files with 27 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: Code coverage
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: Submit code coverage results
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: bash <(curl -s https://codecov.io/bash)
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ chectl
[Eclipse Che](https://github.com/eclipse/che/) CLI

[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
[![Codecov](https://img.shields.io/codecov/c/github/che-incubator/chectl)](https://github.com/che-incubator/chectl)
[![Build Status](https://travis-ci.org/che-incubator/chectl.svg?branch=master)](https://travis-ci.org/che-incubator/chectl)
![](https://img.shields.io/david/che-incubator/chectl.svg)

Expand Down
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 ea36c84

Please sign in to comment.