diff --git a/.github/workflows/pr-main.yml b/.github/workflows/build.yml similarity index 51% rename from .github/workflows/pr-main.yml rename to .github/workflows/build.yml index 83c543c75..b204e90b4 100644 --- a/.github/workflows/pr-main.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Test and lint +name: Build on: push: @@ -18,8 +18,18 @@ jobs: - uses: actions/setup-node@v3 with: node-version: ${{ env.NODE_VERSION }} + - name: Load cached node_modules + uses: actions/cache@v3 + with: + path: node_modules + key: node_modules-${{ hashFiles('yarn.lock') }} - run: yarn - run: yarn test + - name: Upload code coverage + uses: codecov/codecov-action@v2 + with: + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true lint: runs-on: ubuntu-latest steps: @@ -27,5 +37,10 @@ jobs: - uses: actions/setup-node@v3 with: node-version: ${{ env.NODE_VERSION }} + - name: Load cached node_modules + uses: actions/cache@v3 + with: + path: node_modules + key: node_modules-${{ hashFiles('yarn.lock') }} - run: yarn - run: yarn lint diff --git a/README.md b/README.md index 28ede2bf6..55a93aded 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Eightfold Octuple Design System Component Library +[![npm version](https://badge.fury.io/js/@eightfold.ai%2Foctuple.svg)](https://badge.fury.io/js/@eightfold.ai%2Foctuple) [![build status](https://github.com/EightfoldAI/octuple/actions/workflows/pr-main.yml/badge.svg?branch=main)](https://github.com/EightfoldAI/octuple/actions/workflows/pr-main.yml) [![codecov](https://codecov.io/gh/yrchhabra-eightfold/octuple/branch/main/graph/badge.svg?token=K2BV6M1JS5)](https://codecov.io/gh/yrchhabra-eightfold/octuple) + ## About Octuple creates a shared language and visual consistency across different pages and channels. diff --git a/package.json b/package.json index c1c9c66ec..02a27339a 100644 --- a/package.json +++ b/package.json @@ -170,10 +170,6 @@ "roots": [ "/src" ], - "collectCoverageFrom": [ - "src/**/*.{js,jsx,ts,tsx}", - "!src/**/*.d.ts" - ], "setupFiles": [ "react-app-polyfill/jsdom", "jest-localstorage-mock" @@ -214,7 +210,13 @@ "jest-watch-typeahead/filename", "jest-watch-typeahead/testname" ], - "resetMocks": false + "resetMocks": false, + "collectCoverage": true, + "collectCoverageFrom": [ + "src/**/*.{js,jsx,ts,tsx}", + "!src/**/*.d.ts", + "!src/**/*.stories.{js,jsx,ts,tsx}" + ] }, "babel": { "presets": [