From e40cfced29fe459d3501bff9fd7fb76962b5534b Mon Sep 17 00:00:00 2001 From: CyberCitizen01 <77384412+CyberCitizen01@users.noreply.github.com> Date: Tue, 23 Jan 2024 16:12:47 +0530 Subject: [PATCH] fix: failing workflow run because of missing lcov.info file --- .github/workflows/nodejs.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index bcfd0765..2d2c001c 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -45,11 +45,24 @@ jobs: run: | npm run test-coverage-ci || echo "Silently ignoring coverage threshold limit..." + - name: Check if a valid lcov.info file is generated + id: check-lcov-non-empty + run: | + if [ -s "./coverage/lcov.info" ]; then + echo "lcov.info is not empty." + echo "::set-output name=isNotEmpty::true" + else + echo "lcov.info is empty." + echo "::set-output name=isNotEmpty::false" + fi + - name: Install LCOV + if: ${{ steps.check-lcov-non-empty.outputs.isNotEmpty == 'true'}} run: | sudo apt-get update && sudo apt-get install --assume-yes lcov - name: Report code coverage + if: ${{ steps.check-lcov-non-empty.outputs.isNotEmpty == 'true' }} uses: zgosalvez/github-actions-report-lcov@v3 with: coverage-files: ./coverage/lcov.info