feat: add reusable coverage-badge action

This commit is contained in:
Micheal Wilkinson
2026-03-21 00:17:37 +00:00
parent 8d9cc33802
commit 16274ea1e5
4 changed files with 231 additions and 78 deletions

View File

@@ -16,8 +16,8 @@ revision.
## Use In Other Repositories
Vociferate ships two composite actions that together cover the full release flow.
Until release tags are created, reference `@main`. Once tags exist again, pin both actions to the same released tag.
Vociferate ships three composite actions covering release preparation, release publication, and coverage badge publishing.
Until release tags are created, reference `@main`. Once tags exist again, pin all actions to the same released tag.
### `prepare` — update files, commit, and push tag
@@ -109,6 +109,26 @@ assets after it runs:
--data-binary "@dist/myapp"
```
### `coverage-badge` - publish coverage report and badge
Run your coverage tests first, then call the action to generate `coverage.html`, `coverage-badge.svg`, and `coverage-summary.json`, upload them to S3-compatible storage, and emit output URLs.
```yaml
- name: Run tests with coverage
run: go test -covermode=atomic -coverprofile=coverage.out ./...
- id: coverage
uses: git.hrafn.xyz/aether/vociferate/coverage-badge@main
with:
artefact-bucket-name: ${{ vars.ARTEFACT_BUCKET_NAME }}
artefact-bucket-endpoint: ${{ vars.ARTEFACT_BUCKET_ENDPONT }}
- name: Print coverage links
run: |
echo "Report: ${{ steps.coverage.outputs.report-url }}"
echo "Badge: ${{ steps.coverage.outputs.badge-url }}"
```
## Why The Name
> **vociferate** _(verb)_: to cry out loudly or forcefully.