vesan_obsidian-table-beauti.../.github/workflows/ci.yml
Vesa Vänskä 0c18d9123b
test: expand coverage and report it in CI
- Add @vitest/coverage-v8, test:coverage script, vitest.config.ts
- Extract looksLikeTable to src/detect.ts so it is testable without
  pulling the obsidian runtime
- Add edge-case tests for parser, formatter, convert, and detect
  (23 -> 38 tests; line coverage 100% on every file except main.ts)
- Run coverage in CI and append the line % to the step summary
2026-05-25 11:39:06 +03:00

29 lines
715 B
YAML

name: CI
on:
push:
branches: [main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm run build
- run: npm run test:coverage
- name: Coverage summary
if: always()
run: |
if [ -f coverage/coverage-summary.json ]; then
LINE=$(jq -r '.total.lines.pct' coverage/coverage-summary.json)
echo "## Code Coverage" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Line coverage: ${LINE}%**" >> $GITHUB_STEP_SUMMARY
fi