Skip to content

Commit

Permalink
chore(ci): create report code coverage job
Browse files Browse the repository at this point in the history
  • Loading branch information
mihar-22 committed Sep 11, 2020
1 parent 331d739 commit b6e3b87
Showing 1 changed file with 36 additions and 5 deletions.
41 changes: 36 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
run: yarn install

- name: Build
if: steps.deps.outputs.cache-hit != 'false'
if: steps.deps.outputs.cache-hit == 'true'
run: yarn build

test_unit:
Expand All @@ -100,10 +100,11 @@ jobs:
- name: Run unit tests
run: yarn workspace @vime/core test:unit.coverage

- name: Upload report to codecov
run: cd packages/core && npx codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Upload codecov report artifact
uses: actions/upload-artifact@v2
with:
name: codecov-unit
path: packages/core/jest-coverage

instrument:
name: Instrument
Expand Down Expand Up @@ -185,6 +186,30 @@ jobs:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload codecov report artifact
uses: actions/upload-artifact@v2
with:
name: codecov-e2e-${{ matrix.containers }}
path: packages/core/cypress-coverage

codecov:
name: Code Coverage
needs: [test_unit, test_e2e]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup node.js
uses: actions/setup-node@v2-beta
with:
node-version: 14

- name: Download codecov report artifacts
uses: actions/download-artifact@v2
with:
path: packages/core

- name: Upload report to codecov
run: cd packages/core && npx codecov
env:
Expand Down Expand Up @@ -217,6 +242,12 @@ jobs:
run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Restore dependencies
uses: actions/cache@v2
with:
path: '**/node_modules'
key: deps-${{ hashFiles('yarn.lock') }}

- name: Restore build
uses: actions/cache@v2
Expand Down

0 comments on commit b6e3b87

Please sign in to comment.