Skip to content

feat: add workflow step to publish test coverage report #27

feat: add workflow step to publish test coverage report

feat: add workflow step to publish test coverage report #27

# This workflow will build and test a Node.js project
name: Deploy to Firebase Functions via github action
on:
push:
branches: ["feature/*"]
workflow_call:
jobs:
build:
runs-on: ubuntu-22.04
timeout-minutes: 5
permissions:
checks: write
steps:
- uses: actions/checkout@v4
- name: Set up Node v18
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
working-directory: .
run: find ./* -maxdepth 2 -name package.json -execdir npm ci \;
- name: Lint with ESLint
run: DEBUG=eslint:cli-engine npx eslint .
- name: Test with 'ava' and 'nyc'
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()
with:
report_paths: 'test.xml'
check_name: 'Test report'
require_passed_tests: true
detailed_summary: true
include_passed: true
- name: Publish test coverage report
uses: sidx1024/[email protected]
with:
coverage_file: "coverage/coverage-summary.json"