Skip to content

Commit

Permalink
allow to pass path to custom lcov prunning script
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofel committed Sep 18, 2024
1 parent 21b8f9d commit 92e2e0c
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/review-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ on:
type: boolean
required: false
default: true
lcov_prune_script_path:
description: 'path to the lcov_prune script (used to prune lcov report from files that we are not interested in); path should be relative to contracts_directory'
type: string
required: false
default: ''
secrets:
jira_username:
required: false
Expand Down Expand Up @@ -202,17 +207,23 @@ jobs:
FOUNDRY_PROFILE: ${{ inputs.product }}

- name: Prune lcov report
if: ${{ inputs.generate_code_coverage == true }}
if: ${{ inputs.generate_code_coverage == true && inputs.lcov_prune_script_path != '' }}
shell: bash
working-directory: ${{ inputs.contracts_directory }}
run: |
./scripts/lcov_prune ${{ inputs.product }} code-coverage/lcov.info code-coverage/lcov.info.pruned
${{ inputs.lcov_prune_script_path }} ${{ inputs.product }} code-coverage/lcov.info code-coverage/lcov.info.pruned
- name: Generate Code Coverage HTML report for product contracts
if: ${{ inputs.generate_code_coverage == true }}
shell: bash
working-directory: ${{ inputs.contracts_directory }}
run: genhtml code-coverage/lcov.info.pruned --branch-coverage --output-directory code-coverage
run: |
lcov_file="code-coverage/lcov.info"
if [[ -f "code-coverage/lcov.info.pruned" ]]; then
lcov_file="code-coverage/lcov.info.pruned"
fi
echo "::debug::Using $lcov_file for code coverage report generation"
genhtml "$lcov_file" --branch-coverage --output-directory code-coverage
- name: Run Forge doc for product contracts
if: ${{ inputs.generate_forge_book == true }}
Expand Down

0 comments on commit 92e2e0c

Please sign in to comment.