Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an auto-updating test coverage badge to the README, computed entirely inside GitHub Actions (no third-party services). Same approach as 1inch/cross-chain#428.
badgesbranch viahttps://github.com/1inch/cross-chain-sdk/raw/badges/coverage-badge.svg..github/workflows/coverage-badge.yml: on every push tomaster(and manual dispatch) it installs dependencies, runspnpm test:cov, renders the badge SVG, and force-pushes it to thebadgesbranch. On PRs it runs only when the coverage tooling itself changes, and skips publishing. Runner/pnpm/node setup mirrorspr-check.yml(ubuntu-latest, pnpm 10, node 20).scripts/generate-coverage-badge.mjs: renders a shields.io-style SVG (total line coverage, color-coded) from Jest'sjson-summaryreporter output.package.json: adds atest:covscript (jest --coveragewithtext-summary+json-summaryreporters).jest.config.js: coverage reports now land in<repo>/coverage(gitignored) instead ofsrc/coverage—coverageDirectoryis resolved relative torootDir(src), so the previous value wrote inside the source tree.The
badgesbranch has been seeded with the real current value (88.2% line coverage), so the README renders immediately; the workflow refreshes it on every subsequent push tomaster.Verification
pull_requestrun of theCoverage badgeworkflow on this PR passed (23 suites / 133 tests, total line coverage 88.2%).PR validationfailure is unrelated: npm retired its legacy audit endpoint (HTTP 410 fromregistry.npmjs.org/-/npm/v1/security/audits), which breaks thepnpm auditstep on every branch as of today — the same step passed on other PRs as recently as July 14.Notes
jest.config.js); integration tests are not included.GITHUB_TOKENhavingcontents: write(declared in the workflow). If the org enforces read-only workflow tokens, the push step will fail and a PAT/deploy key would be needed instead.