Skip to content

Commit

Permalink
feat: update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sirishgf committed Jan 2, 2024
1 parent c3e1bd7 commit 8755a4e
Showing 1 changed file with 35 additions and 9 deletions.
44 changes: 35 additions & 9 deletions .github/workflows/node-ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name: Deploy to Firebase Functions via github action
on:
push:
branches: ["feature/*"]
pull_request:
branches: ["feature/*", "main"]
workflow_call:

jobs:
Expand Down Expand Up @@ -34,14 +36,6 @@ jobs:
id: unit-tests-step
run: find ./* -maxdepth 2 -name ava.config.js -print0 | xargs --null -I {} npx nyc ava --tap | npx tap-junit > test.xml

# - name: Upload test artifact
# id: upload-test-artifact
# uses: actions/upload-artifact@v4
# with:
# name: my-artifact
# path: coverage/lcov-report
# retention-days: 14

- name: Publish test report
uses: mikepenz/action-junit-report@v4
if: success() || failure()
Expand All @@ -51,8 +45,40 @@ jobs:
require_passed_tests: true
detailed_summary: true
include_passed: true

- name: Generate test coverage report
id: unit-tests-cov-step
run: find ./* -maxdepth 1 -name package.json -print0 | xargs --null -I {} npx nyc report --reporter json-summary --reporter cobertura

- name: Publish test coverage report
uses: sidx1024/[email protected]
with:
coverage_file: "coverage/coverage-summary.json"
coverage_file: "coverage/coverage-summary.json"

- name: Code Coverage Summary Report
uses: irongut/[email protected]
id: cov-report
with:
filename: coverage/cobertura-coverage.xml
badge: true
format: markdown
indicators: true
output: both
thresholds: '60 80'

- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md


- name: Add Coverage check
uses: LouisBrunner/[email protected]
if: always()
with:
name: Test coveragec
conclusion: ${{ job.status }}
output: |
{"summary":"${{ steps.cov-report.outputs.summary }}"}

0 comments on commit 8755a4e

Please sign in to comment.