Skip to content

Commit

Permalink
Create publish-test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
siyaramblackduck authored Jul 4, 2024
1 parent 8c76e97 commit 76ef6c1
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/publish-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: publish-test

on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
branches:
- main
paths-ignore:
- '**.md'
workflow_dispatch:

jobs:
code-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x

# - name: Install dependencies
# run: cd synopsys-task && npm ci

# - name: Unit Test Cases
# id: unit-test-cases
# shell: bash
# run: |
# cd synopsys-task && npm run test
# coverageFile="coverage/index.html"

# ### fetching line coverage from coverage/index.html file
# coverageSpan=$(grep -B 1 '<span class="quiet">Lines</span>' $coverageFile | head -n 1)
# coverageHtml=$(echo "$coverageSpan" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
# coverageInPercent=$(echo $coverageHtml | sed -n 's/.*<span class="strong">\([0-9.]*%\).*/\1/p' | tr -d ' ')
# echo "Line Coverage: $coverageInPercent"

# ### remove percentage sign from coverageInPercent and convert to a floatin-point number
# coverageValue=$(echo "$coverageInPercent" | tr -d '%' | sed 's/,/./g')
# ### check if the coverage is below 90%
# if [[ $coverageValue < 90 ]]; then
# echo "##[error]Line coverage is below 90%"
# exit 1
# fi

0 comments on commit 76ef6c1

Please sign in to comment.