From 1e3c1abfb403c3d7de4f50aa07ee8f62cc1844d5 Mon Sep 17 00:00:00 2001 From: Zohaib Ijaz Date: Fri, 12 Jan 2024 20:04:21 +0500 Subject: [PATCH] Added code to save coverage badge and added badge url in README.md --- .github/workflows/test.yml | 32 +++++++++++++++++++------------- README.md | 2 +- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 77d62a4..67c30e1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,13 +5,12 @@ name: Test Coverage on: push: - branches: [ "main" ] + branches: ['main'] pull_request: - branches: [ "main" ] + branches: ['main'] jobs: test: - runs-on: ubuntu-latest strategy: @@ -19,13 +18,20 @@ jobs: node-version: [20.10] steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - run: npm ci - - run: npm run build --if-present - - run: npm run coverage - - run: npm run coverage-badge + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run build --if-present + - run: npm run coverage + - run: npm run coverage-badge + - name: Save Coverage Badge + uses: exuanbo/actions-deploy-gist@v1 + with: + token: ${{ secrets.GIST_SECRET }} + gist_id: 3b32f9904f8a8e0ebe7dbf8f4417a1f9 + file_path: coverage/coverage.svg + file_type: text diff --git a/README.md b/README.md index a0d0aa8..7e80061 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # E-Store -Coverage +Coverage All components have complete code coverage and are fully unit tested. E2E tests are cypress based.