Skip to content

Commit

Permalink
Merge pull request #7 from gitcoindev/bugfix-incorrect-coverage-value…
Browse files Browse the repository at this point in the history
…s-in-the-compare-test-coverage-workflow

Bugfix incorrect coverage values in the compare test coverage workflow
  • Loading branch information
gitcoindev authored Oct 26, 2023
2 parents 6e45c80 + 962d9f4 commit 5cbc161
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/coverage-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
uses: actions/checkout@v3
with:
ref: development
path: development

- name: Setup Foundry
uses: foundry-rs/foundry-toolchain@v1
Expand All @@ -30,11 +31,10 @@ jobs:

- name: Get development branch coverage
id: coverage-development
working-directory: development/packages/contracts
run: |
cd ./packages/contracts
# generates lcov.info
forge coverage --report lcov
forge build && forge coverage --report lcov
# Foundry uses relative paths but Hardhat uses absolute paths.
# Convert absolute paths to relative paths for consistency.
Expand All @@ -59,28 +59,25 @@ jobs:
"src/dollar/utils/*" \
"test/*" \
# Generate summary
COVERAGE_DEVELOPMENT_OUTPUT=$(lcov \
--rc lcov_branch_coverage=1 \
--list filtered-lcov.info)
echo COVERAGE=$(echo "${COVERAGE_DEVELOPMENT_OUTPUT}" | tail -n 1 | cut -d % -f 1 | cut -d \| -f 2) >> $GITHUB_OUTPUT
- name: Delete development branch folder
run: rm -rf development

- name: Checkout code in PR branch
uses: actions/checkout@v3

- name: Update Forge Dependencies
working-directory: packages/contracts
run: forge update lib/forge-std

- name: Get PR branch coverage
id: coverage-pr
working-directory: packages/contracts
run: |
cd ./packages/contracts
# generates lcov.info
forge coverage --report lcov
forge build && forge coverage --report lcov
# Foundry uses relative paths but Hardhat uses absolute paths.
# Convert absolute paths to relative paths for consistency.
Expand All @@ -105,7 +102,6 @@ jobs:
"src/dollar/utils/*" \
"test/*" \
# Generate summary
COVERAGE_DEVELOPMENT_OUTPUT=$(lcov \
--rc lcov_branch_coverage=1 \
Expand Down

0 comments on commit 5cbc161

Please sign in to comment.