Skip to content

Commit 87e0cde

Browse files
authored
Merge pull request #14 from datachainlab/install-coverage-report
Install Coverage Report
2 parents 371fc21 + f41e94c commit 87e0cde

File tree

4 files changed

+65
-2
lines changed

4 files changed

+65
-2
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Coverage Report
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
13+
jobs:
14+
coverage-report:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Setup Node
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: '25'
23+
24+
- run: npm ci
25+
- run: npm run coverage:sol
26+
- uses: hrishikesh-kadam/setup-lcov@v1
27+
28+
- name: Report code coverage
29+
uses: zgosalvez/github-actions-report-lcov@v5
30+
with:
31+
coverage-files: lcov.info
32+
minimum-coverage: 0 # TODO: Once new tests are added, increase minimum-coverage from 0 to a realistic gate (e.g., 5–10%), and keep bumping it as coverage improves.
33+
artifact-name: code-coverage-report
34+
github-token: ${{ secrets.GITHUB_TOKEN }}
35+
update-comment: true

.husky/pre-commit

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
set -e
5+
6+
npm run fmt:sol
7+
8+
git add -A

package-lock.json

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
"scripts": {
55
"deploy": "forge script script/DeployAll.s.sol --rpc-url anvil --broadcast",
66
"compile": "forge build",
7-
"postinstall": "forge build",
7+
"postinstall": "husky && forge build",
88
"clean": "rm -rf build",
99
"test": "forge test -vvv",
10-
"lint:sol": "solhint -f table 'src/**/*.sol' 'test/**/*.sol' 'script/**/*.sol'"
10+
"lint:sol": "solhint -f table 'src/**/*.sol' 'test/**/*.sol' 'script/**/*.sol'",
11+
"fmt:sol": "forge fmt",
12+
"coverage:sol": "forge coverage --report lcov"
1113
},
1214
"dependencies": {
1315
"@hyperledger-labs/yui-ibc-solidity": "git+https://github.com/hyperledger-labs/yui-ibc-solidity.git#v0.3.40",
@@ -17,6 +19,7 @@
1719
},
1820
"devDependencies": {
1921
"@foundry-rs/forge": "1.4.1",
22+
"husky": "^9.1.7",
2023
"solhint": "^6.0.1"
2124
}
2225
}

0 commit comments

Comments
 (0)