Skip to content

Commit

Permalink
Use coverage.out file
Browse files Browse the repository at this point in the history
  • Loading branch information
jp-imx committed Nov 13, 2023
1 parent 349f8e5 commit 09537e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/actions/coverage/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const core = require('@actions/core');
const fs = require('fs');

const inputs = {
coverage: core.getInput('coverage'),
Expand All @@ -8,6 +9,7 @@ const inputs = {
(async () => {
const { updateComment } = require("../../utils/github");

await updateComment(inputs.coverage);
const data = fs.readFileSync(inputs.coverage, { encoding: 'utf8', flag: 'r' });
await updateComment(data);
})();

6 changes: 3 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ jobs:

- name: Run Forge coverage
run: |
echo "COVERAGE=$(forge coverage --report summary)" >> $GITHUB_OUTPUT
forge coverage --report summary > ./coverage.out
id: coverage

- name: Debug coverage report
run: |
echo ${{ steps.coverage.outputs.COVERAGE }}
cat ./coverage.out
- name: Publish report
uses: ./.github/actions/coverage
with:
coverage: ${{ steps.coverage.outputs.COVERAGE }}
coverage: ./coverage.out

0 comments on commit 09537e4

Please sign in to comment.