https://github.com/codefiesta/swift-coverage-action
A Github action that parses a swift test coverage report and outputs a percentage for displaying a badge.
https://github.com/codefiesta/swift-coverage-action
continuous-integration coverage-reports coverage-testing github-actions swift swift-package-manager
Last synced: 28 days ago
JSON representation
A Github action that parses a swift test coverage report and outputs a percentage for displaying a badge.
- Host: GitHub
- URL: https://github.com/codefiesta/swift-coverage-action
- Owner: codefiesta
- License: mit
- Created: 2025-06-05T03:46:02.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-06-20T16:48:40.000Z (12 months ago)
- Last Synced: 2026-05-04T22:43:36.846Z (28 days ago)
- Topics: continuous-integration, coverage-reports, coverage-testing, github-actions, swift, swift-package-manager
- Language: JavaScript
- Homepage:
- Size: 1.19 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README

[](https://opensource.org/licenses/MIT)
# Swift Coverage Action
Swift Coverage Action is a simple Github action that parses a swift test coverage report and outputs a percentage for displaying a badge.
## Usage
The following is an example of how to setup a Github action that extracts the percentage output from the Swift Coverage Action and pushes the output (code coverage percentage) into the [Dynamic Badges Action](https://github.com/marketplace/actions/dynamic-badges).
```yml
name: Swift Coverage
jobs:
build:
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Build
run: swift build -v
- name: Test
run: swift test --enable-code-coverage
- id: coverage
uses: codefiesta/swift-coverage-action@0.0.1
- name: badge
# Only run the badge update if we are pushing to main
if: github.ref == 'refs/heads/main'
uses: schneegans/dynamic-badges-action@v1.7.0
with:
auth: ${{secrets.GIST_SECRET}}
gistID:
filename: coverage.json
label: Coverage
message: ${{steps.coverage.outputs.percentage}}%
color: white
```