Skip to content

Commit

Permalink
Added code to save coverage badge and added badge url in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mzohaibqc committed Jan 12, 2024
1 parent a48fb06 commit 1e3c1ab
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
32 changes: 19 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,33 @@ name: Test Coverage

on:
push:
branches: [ "main" ]
branches: ['main']
pull_request:
branches: [ "main" ]
branches: ['main']

jobs:
test:

runs-on: ubuntu-latest

strategy:
matrix:
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# E-Store

<img src="./coverage/coverage.svg" width="170" height="30" alt="Coverage" />
<img src="https://gist.githubusercontent.com/mzohaibqc/3b32f9904f8a8e0ebe7dbf8f4417a1f9/raw/1618ae740e2f8ab4d1080c0eda3fbbcd42ad9bda/coverage.svg" width="170" height="30" alt="Coverage" />

All components have complete code coverage and are fully unit tested. E2E tests are cypress based.

Expand Down

0 comments on commit 1e3c1ab

Please sign in to comment.