Skip to content

Commit 81fc9f2

Browse files
committed
fix: output lcov coverage for CI Codecov upload
Add test:coverage:self scripts that output lcov.info to coverage/ for issuance, horizon, and subgraph-service. Create coverage dir before running forge coverage (forge does not create it). Update CI workflow to find both Istanbul JSON and lcov coverage files.
1 parent 039b2be commit 81fc9f2

4 files changed

Lines changed: 5 additions & 4 deletions

File tree

.github/workflows/build-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ jobs:
3333
- name: Find coverage files
3434
id: coverage_files
3535
run: |
36-
# Find all coverage-final.json files
37-
COVERAGE_FILES=$(find ./packages -name "coverage-final.json" -path "*/coverage/*" | tr '\n' ',' | sed 's/,$//')
36+
# Find coverage files: Istanbul JSON (Hardhat) and lcov (Forge)
37+
COVERAGE_FILES=$(find ./packages \( -name "coverage-final.json" -o -name "lcov.info" \) -path "*/coverage/*" | tr '\n' ',' | sed 's/,$//')
3838
echo "files=$COVERAGE_FILES" >> $GITHUB_OUTPUT
3939
echo "Found coverage files: $COVERAGE_FILES"
4040

packages/horizon/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"test:deployment": "SECURE_ACCOUNTS_DISABLE_PROVIDER=true hardhat test test/deployment/*.ts",
3636
"test:integration": "./scripts/integration",
3737
"test:coverage": "pnpm build && pnpm test:coverage:self",
38-
"test:coverage:self": "forge coverage",
38+
"test:coverage:self": "mkdir -p coverage && forge coverage --report lcov --report-file coverage/lcov.info",
3939
"prepublishOnly": "pnpm run build"
4040
},
4141
"devDependencies": {

packages/issuance/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"typechain": "typechain --target ethers-v6 --out-dir typechain-src 'artifacts/contracts/**/!(*.dbg).json' && tsc -p tsconfig.typechain.json && rm -rf typechain-src && echo '{\"type\":\"commonjs\"}' > types/package.json",
3030
"test": "forge test",
3131
"test:coverage": "forge coverage",
32+
"test:coverage:self": "mkdir -p coverage && forge coverage --report lcov --report-file coverage/lcov.info",
3233
"lint": "pnpm lint:ts; pnpm lint:sol; pnpm lint:forge; pnpm lint:md; pnpm lint:json",
3334
"lint:ts": "eslint '**/*.{js,ts,cjs,mjs,jsx,tsx}' --fix --cache; prettier -w --cache --log-level warn '**/*.{js,ts,cjs,mjs,jsx,tsx}'",
3435
"lint:sol": "solhint --fix --noPrompt --noPoster 'contracts/**/*.sol'; prettier -w --cache --log-level warn 'contracts/**/*.sol'",

packages/subgraph-service/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"test:deployment": "SECURE_ACCOUNTS_DISABLE_PROVIDER=true hardhat test test/deployment/*.ts",
3434
"test:integration": "./scripts/integration",
3535
"test:coverage": "pnpm build && pnpm test:coverage:self",
36-
"test:coverage:self": "forge coverage",
36+
"test:coverage:self": "mkdir -p coverage && forge coverage --report lcov --report-file coverage/lcov.info",
3737
"prepublishOnly": "pnpm run build"
3838
},
3939
"devDependencies": {

0 commit comments

Comments
 (0)