Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,25 @@ jobs:
- run: pnpm --filter markform test:coverage

# Post coverage report (PR comment + job summary)
# Uses merged coverage from tryscript (vitest + tryscript CLI tests combined)
- name: Coverage Report
uses: davelosert/vitest-coverage-report-action@v2
if: always()
with:
# Working directory for monorepo support - action looks for vite config and coverage files here
working-directory: packages/markform
json-summary-path: coverage/coverage-summary.json
json-summary-path: coverage-tryscript/coverage-summary.json
json-final-path: coverage/coverage-final.json
Comment on lines +41 to 42

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Point file coverage input at merged output

The workflow now reads the summary from coverage-tryscript, but json-final-path still points at coverage/coverage-final.json, which is vitest-only. The project docs note that json-final-path (the json reporter) is what the action uses for file-specific coverage, while json-summary drives the totals (docs/general/research/current/research-code-coverage-typescript.md lines 209–225). With the current mix, the PR comment’s file table will ignore tryscript coverage, so files covered only by CLI tests will show 0% even though the totals include them. Consider pointing json-final-path to the merged output (and ensuring a merged json file exists) or disabling file coverage until it does.

Useful? React with 👍 / 👎.

# Only show changed files on PRs, show all on main
file-coverage-mode: ${{ github.event_name == 'pull_request' && 'changes' || 'all' }}

# Generate and commit coverage badges (main branch only)
# Uses merged coverage from tryscript (vitest + tryscript CLI tests combined)
- name: Coverage Badges
uses: jpb06/coverage-badges-action@v1.4.6
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
with:
coverage-summary-path: packages/markform/coverage/coverage-summary.json
coverage-summary-path: packages/markform/coverage-tryscript/coverage-summary.json
output-folder: ./badges
branches: main

Expand Down
2 changes: 1 addition & 1 deletion packages/markform/tryscript.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default defineConfig({
// See: https://github.com/jlevy/tryscript/blob/main/docs/tryscript-reference.md
coverage: {
reportsDir: 'coverage-tryscript',
reporters: ['text', 'text-summary', 'html', 'lcov'],
reporters: ['text', 'text-summary', 'html', 'lcov', 'json-summary'],
include: ['dist/**'],
src: 'src',
excludeNodeModules: true,
Expand Down