Skip to content

Commit ed1e062

Browse files
authored
✨ feature: Add Codecov Report (#50)
* ✨ feature: Add Codecov Report * 📜 docs: Update Changelog * 📜 docs: Add Codecov Badge * Update README.md * 🏗 build: Increase Version of Codecov Action * Update ct-matrix.yml
1 parent 524a12d commit ed1e062

3 files changed

Lines changed: 22 additions & 3 deletions

File tree

.github/workflows/ct-matrix.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
# Skip: README, LICENSE, .gitignore, GitHub Workflows & Actions, etc.
4747
- name: Check for Changes to Determine if Tests can be Skipped
4848
id: getChanges
49-
uses: tj-actions/changed-files@v45.0.2
49+
uses: tj-actions/changed-files@v45.0.3
5050
with:
5151
files_ignore: |
5252
README.md
@@ -86,6 +86,7 @@ jobs:
8686
####################################################################################################
8787
### Run Tests ###
8888
####################################################################################################
89+
# Test 1 - Build Solution
8990
- name: Build
9091
if: ${{ !fromJSON(steps.getCanSkip.outputs.result) }}
9192
run: dotnet build --no-restore
@@ -97,17 +98,29 @@ jobs:
9798
message: '[Error] Build Failed for ${{ matrix.solution }}'
9899

99100
# Test 2 - Run All Unit Tests within Project
100-
# Note: This Action Requires Windows
101101
- name: Run Tests for [${{ matrix.solution }}]
102102
if: ${{ !fromJSON(steps.getCanSkip.outputs.result) }}
103-
run: dotnet test --no-build --verbosity normal
103+
run: dotnet test --no-build --verbosity normal --collect "XPlat Code Coverage"
104104

105105
- name: Error - Tests Failed for ${{ matrix.solution }}
106106
if: failure()
107107
uses: ./.github/actions/tools/annotation/error
108108
with:
109109
message: '[Error] Tests Failed for ${{ matrix.solution }}'
110110

111+
####################################################################################################
112+
### Code Coverage ###
113+
####################################################################################################
114+
- name: Upload Results to Codecov (Optional)
115+
if: ${{ !fromJSON(steps.getCanSkip.outputs.result) }}
116+
uses: codecov/codecov-action@v4
117+
with:
118+
token: ${{ secrets.CODECOV_TOKEN }}
119+
files: '**/TestResults/**/coverage.cobertura.xml'
120+
flags: unittests
121+
fail_ci_if_error: true
122+
verbose: true
123+
111124
####################################################################################################
112125
### Notify Success ###
113126
####################################################################################################

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Codecov reporting
13+
1014
## [0.2.2] - 2024-10-20
1115

1216
## [0.2.1] - 2024-10-16

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
[![NuGet Downloads](https://img.shields.io/nuget/dt/TJC.StringExtensions)](https://www.nuget.org/packages/TJC.StringExtensions) ![Size](https://img.shields.io/github/repo-size/TJC-Tools/TJC.StringExtensions) [![License](https://img.shields.io/github/license/TJC-Tools/TJC.StringExtensions.svg)](LICENSE)
44

5+
[![codecov](https://codecov.io/gh/TJC-Tools/TJC.StringExtensions/graph/badge.svg?token=RJ4DWNQ7S5)](https://codecov.io/gh/TJC-Tools/TJC.StringExtensions)
6+
57
## Table of Contents
68
- [Pluralize](#pluralize)
79
- [Separator](#separator)

0 commit comments

Comments
 (0)