fix: Remove Push Notification feature #10221
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit Tests | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
types: [opened, synchronize, edited] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [12.x] | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16 | |
- name: Install dependencies | |
run: npm install --save-dev --legacy-peer-deps | |
- name: Run Tests | |
run: npm run test | |
- name: Unit Test Coverage | |
uses: fylein/comment-test-coverage@master | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
path: coverage/coverage-summary.json | |
title: Unit Test Coverage | |
- name: Check Coverage Percentage | |
run: | | |
lines=$(jq '.total.lines.pct' < coverage/coverage-summary.json) | |
statements=$(jq '.total.statements.pct' < coverage/coverage-summary.json) | |
branches=$(jq '.total.branches.pct' < coverage/coverage-summary.json) | |
functions=$(jq '.total.functions.pct' < coverage/coverage-summary.json) | |
if (( $(echo "$lines < 95.0" | bc -l) || \ | |
$(echo "$statements < 95.0" | bc -l) || \ | |
$(echo "$branches < 91.10" | bc -l) || \ | |
$(echo "$functions < 94.0" | bc -l) )); then | |
echo "Code Coverage Percentage is below 95%" | |
exit 1 | |
fi |