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
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 # ###################################################################################################
0 commit comments