mirror of
https://github.com/vesan/obsidian-table-beautifier.git
synced 2026-07-22 06:53:19 +00:00
- 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
29 lines
715 B
YAML
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
|