Skip to content

Added test.yml file to run test and save coverage badge #8

Added test.yml file to run test and save coverage badge

Added test.yml file to run test and save coverage badge #8

Workflow file for this run

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Test Coverage
on:
push:
branches: ['main']
pull_request:
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
- 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