diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 000000000..57af480a3 --- /dev/null +++ b/.github/workflows/codecov.yml @@ -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) diff --git a/package.json b/package.json index e19b76b34..a3139e71f 100644 --- a/package.json +++ b/package.json @@ -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'", @@ -161,6 +161,7 @@ "types": "lib/index.d.ts", "jest": { "collectCoverage": true, + "coverageReporters": ["json"], "collectCoverageFrom": [ "src/**/*.ts" ],