Skip to content

Commit

Permalink
Merge pull request #267 from sablierhq/prb/codecov
Browse files Browse the repository at this point in the history
ci: switch coverage report to Codecov instead of Coveralls
  • Loading branch information
PaulRBerg authored Jan 18, 2023
2 parents 0d84c53 + a68245d commit c97fa67
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ignore:
- "./test"
12 changes: 4 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,11 @@ jobs:
- name: "Generate the coverage report"
run: "forge coverage --report lcov"

# See discussion in https://github.com/foundry-rs/foundry/issues/1961
- name: "Delete the coverage report generated for the test contracts"
run: "git clean -f -- ./test"

- name: "Upload coverage report to Coveralls"
uses: "coverallsapp/github-action@master"
- name: "Upload coverage report to Codecov"
uses: "codecov/codecov-action@v3"
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
path-to-lcov: "./lcov.info"
files: "./lcov.info"
token: ${{ secrets.CODECOV_TOKEN }}

- name: "Add coverage summary"
run: |
Expand Down
3 changes: 3 additions & 0 deletions src/SablierV2Pro.sol
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ contract SablierV2Pro is
uint128 previousSegmentAmounts;
uint40 currentSegmentMilestone = _streams[streamId].segments[0].milestone;
uint256 index = 1;

// Important: this function must be called only after checking that the current time is less than the last
// segment's milestone, lest the loop below encounters an "index out of bounds" error.
while (currentSegmentMilestone < currentTime) {
previousSegmentAmounts += _streams[streamId].segments[index - 1].amount;
currentSegmentMilestone = _streams[streamId].segments[index].milestone;
Expand Down

0 comments on commit c97fa67

Please sign in to comment.