Skip to content

Commit

Permalink
test: Test coverage using Codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
amosavian committed Jun 18, 2024
1 parent 57f47a6 commit ea4fdac
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow will submit
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift

name: Codecov

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
coverage_test:
name: Swift ${{ matrix.swift }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-14, ubuntu-latest]
swift: ["5.10", "5.9"]
timeout-minutes: 60
steps:
- uses: swift-actions/setup-swift@v2
with:
swift-version: ${{ matrix.swift }}
- uses: actions/checkout@v4
- name: Get swift version
run: swift --version
- name: Run tests
run: swift test -v --enable-code-coverage
- name: Submit code coverage
uses: vapor/swift-codecov-action@v0.3
with:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A library for working with JSON Web Signature (JWS) and JSON Web Token (JWT).
[![Quality Gate Status][sonar-quality-badge]][sonar-link]
[![Technical Debt][sonar-tech-debt-badge]][sonar-link]
[![Maintainability Rating][sonar-maintainability-badge]][sonar-link]
[![Coverage][sonar-coverage-badge]][sonar-link]
[![Coverage][codecov-coverage-badge]][codecov-link]

[![][swift-versions-badge]][spi-url]
[![][platforms-badge]][spi-url]
Expand Down Expand Up @@ -143,12 +143,13 @@ For detailed usage and API documentation, check [the documentation][docs].
[release-url]: https://github.com/amosavian/JWSETKit/releases

[sonar-link]: https://sonarcloud.io/summary/new_code?id=amosavian_JWSETKit
[codecov-link]: https://codecov.io/gh/amosavian/JWSETKit
[sonar-quality-badge]: https://sonarcloud.io/api/project_badges/measure?project=amosavian_JWSETKit&metric=alert_status
[sonar-cloc-badge]: https://sonarcloud.io/api/project_badges/measure?project=amosavian_JWSETKit&metric=ncloc
[sonar-duplicated-lines-badge]: https://sonarcloud.io/api/project_badges/measure?project=amosavian_JWSETKit&metric=duplicated_lines_density
[sonar-maintainability-badge]: https://sonarcloud.io/api/project_badges/measure?project=amosavian_JWSETKit&metric=sqale_rating
[sonar-tech-debt-badge]: https://sonarcloud.io/api/project_badges/measure?project=amosavian_JWSETKit&metric=sqale_index
[sonar-coverage-badge]: https://sonarcloud.io/api/project_badges/measure?project=amosavian_JWSETKit&metric=coverage
[codecov-coverage-badge]: https://codecov.io/gh/amosavian/JWSETKit/graph/badge.svg?token=PIYYY5XWAG

[swift-versions-badge]: https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Famosavian%2FJWSETKit%2Fbadge%3Ftype%3Dswift-versions
[spi-url]: https://swiftpackageindex.com/amosavian/JWSETKit
Expand Down

0 comments on commit ea4fdac

Please sign in to comment.