Skip to content

Commit 28b6e82

Browse files
committed
gh workflow summary
1 parent b5e8e09 commit 28b6e82

3 files changed

Lines changed: 35 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,30 @@ jobs:
5151

5252
- name: Run tests and lint
5353
run: pnpm -r run test
54+
55+
- name: Generate coverage summary
56+
if: always()
57+
run: |
58+
echo "## Code Coverage Report (Node ${{ matrix.node-version }})" >> $GITHUB_STEP_SUMMARY
59+
echo "" >> $GITHUB_STEP_SUMMARY
60+
61+
# SDK Coverage
62+
if [ -f "packages/b2c-tooling-sdk/coverage/lcov.info" ]; then
63+
echo "### @salesforce/b2c-tooling-sdk" >> $GITHUB_STEP_SUMMARY
64+
echo "" >> $GITHUB_STEP_SUMMARY
65+
echo '```' >> $GITHUB_STEP_SUMMARY
66+
cd packages/b2c-tooling-sdk && pnpm c8 report --reporter=text-summary 2>/dev/null | tail -n 6 >> $GITHUB_STEP_SUMMARY
67+
cd ../..
68+
echo '```' >> $GITHUB_STEP_SUMMARY
69+
echo "" >> $GITHUB_STEP_SUMMARY
70+
fi
71+
72+
# CLI Coverage
73+
if [ -f "packages/b2c-cli/coverage/lcov.info" ]; then
74+
echo "### @salesforce/b2c-cli" >> $GITHUB_STEP_SUMMARY
75+
echo "" >> $GITHUB_STEP_SUMMARY
76+
echo '```' >> $GITHUB_STEP_SUMMARY
77+
cd packages/b2c-cli && pnpm c8 report --reporter=text-summary 2>/dev/null | tail -n 6 >> $GITHUB_STEP_SUMMARY
78+
cd ../..
79+
echo '```' >> $GITHUB_STEP_SUMMARY
80+
fi

packages/b2c-cli/.c8rc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"test/**",
66
"**/*.d.ts"
77
],
8-
"reporter": ["text", "html", "lcov"],
8+
"reporter": ["text", "text-summary", "html", "lcov"],
99
"report-dir": "coverage"
1010
}

packages/b2c-tooling-sdk/.c8rc.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
"test/**",
77
"**/*.d.ts"
88
],
9-
"reporter": ["text", "html", "lcov"],
10-
"report-dir": "coverage"
9+
"reporter": ["text", "text-summary", "html", "lcov"],
10+
"report-dir": "coverage",
11+
"check-coverage": true,
12+
"lines": 5,
13+
"functions": 5,
14+
"branches": 5,
15+
"statements": 5
1116
}

0 commit comments

Comments
 (0)