Skip to content

docs: add code coverage svg #14

docs: add code coverage svg

docs: add code coverage svg #14

Workflow file for this run

# This is a basic workflow to automate run-tests & update code coverage percent with Actions
name: Update Coverage Badge
# Controls when the action will run. Triggers the workflow on push
# events but only for the master branch
on:
push:
branches: [master]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
matrix:
node: [16, 18]
# Setup env for running test
env:
NODE_ENV: 'test'
MONGO_URI: ${{ secrets.MONGO_URI }}
APP_ID: ${{ secrets.APP_ID }}
APP_PASSWORD: ${{ secrets.APP_PASSWORD }}
TOKEN_SECRET: ${{ secrets.TOKEN_SECRET }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm i
- name: Run tests and collect coverage
run: node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage --forceExit
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}