Skip to content

Commit

Permalink
👷 Update lcov to Version 2.2
Browse files Browse the repository at this point in the history
Signed-off-by: Pascal Marco Caversaccio <[email protected]>
  • Loading branch information
pcaversaccio committed Dec 17, 2024
1 parent 1d93d19 commit 1a9bc5e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/test-createx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,21 +144,23 @@ jobs:
FOUNDRY_PROFILE: default

- name: Run coverage
run: NO_COLOR=1 forge coverage --report summary --report lcov >> $GITHUB_STEP_SUMMARY
run: NO_COLOR=1 forge coverage --report summary --report lcov --lcov-version 2.2 >> $GITHUB_STEP_SUMMARY
env:
FOUNDRY_PROFILE: default

- name: Setup LCOV
uses: hrishikesh-kadam/setup-lcov@v1
with:
ref: v2.2

# See https://github.com/ScopeLift/foundry-template/blob/fd3875d2e99a65dec19431723d6516b4ed76746e/.github/workflows/ci.yml#L49-L78.
- name: Remove unnecessary `test` directory
run: lcov --remove lcov.info 'test/*' --output-file lcov.info --rc lcov_branch_coverage=1
run: lcov --branch-coverage --remove lcov.info 'test/*' --output-file lcov.info --ignore-errors inconsistent

- name: Post coverage report
# See https://github.com/orgs/community/discussions/26829#discussioncomment-3253575.
if: ${{ (github.event.pull_request.head.repo.full_name == github.repository && github.event_name == 'pull_request') }}
uses: sunsergdev/lcov-reporter-action@v0.3.1-fork
if: ${{ (github.event.pull_request.head.repo.full_name == github.repository && github.event_name == 'pull_request') || (github.event.pull_request.head.repo.full_name != github.repository && github.event_name == 'pull_request_target') }}
uses: romeovs/lcov-reporter-action@v0.4.0
with:
title: "`CreateX` Test Coverage Report"
delete-old-comments: true
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"clean": "npx hardhat clean && forge clean",
"test": "forge test --out forge-artifacts",
"snapshot": "forge snapshot --out forge-artifacts",
"coverage": "forge coverage --report summary",
"coverage:report": "forge coverage --report lcov && lcov --remove lcov.info \"test/*\" --output-file lcov.info --rc lcov_branch_coverage=1 && genhtml lcov.info --branch-coverage --output-dir coverage",
"coverage": "forge coverage --report summary --out forge-artifacts --lcov-version 2.2",
"coverage:report": "forge coverage --report lcov --out forge-artifacts --lcov-version 2.2 && lcov --branch-coverage --remove lcov.info \"test/*\" --output-file lcov.info --ignore-errors inconsistent && genhtml lcov.info --branch-coverage --output-dir coverage --ignore-errors inconsistent",
"compile": "npx hardhat compile && forge build --out forge-artifacts",
"size": "npx hardhat size-contracts",
"abi": "npx hardhat export-abi",
Expand Down

0 comments on commit 1a9bc5e

Please sign in to comment.