File tree Expand file tree Collapse file tree 3 files changed +40
-2
lines changed Expand file tree Collapse file tree 3 files changed +40
-2
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,11 @@ inputs:
2929 code-coverage-output-format :
3030 description : ' Code coverage output format. Default: cobertura'
3131 required : false
32- default : ' coverage'
32+ default : ' cobertura'
33+ code-coverage-settings-file :
34+ description : ' Code coverage settings file. Default: '
35+ required : false
36+ default : ' '
3337 upload-test-artifacts :
3438 description : ' Upload test artifacts, Default: true'
3539 required : false
6872 - if : ${{ inputs.collect-code-coverage == 'true' }}
6973 name : ' Set CODE_COVERAGE_ARGS environment variable'
7074 shell : bash
71- run : echo "CODE_COVERAGE_ARGS=--coverage --coverage-output-format ${{ inputs.code-coverage-output-format}}" >> $GITHUB_ENV
75+ run : |
76+ echo "CODE_COVERAGE_ARGS=--coverage --coverage-output-format ${{ inputs.code-coverage-output-format}}" >> $GITHUB_ENV
77+
78+ - if : ${{ inputs.collect-code-coverage == 'true' && inputs.code-coverage-settings-file != ''}}
79+ name : ' Set CODE_COVERAGE_ARGS environment variable'
80+ shell : bash
81+ run : |
82+ echo "CODE_COVERAGE_ARGS=${{ env.CODE_COVERAGE_ARGS }} --coverage-settings ${{ inputs.code-coverage-settings-file }}" >> $GITHUB_ENV
7283
7384 - name : ' Test with .NET CLI'
7485 shell : bash
Original file line number Diff line number Diff line change 9898 with :
9999 test-project-glob-pattern : ${{ vars.TEST_DEFAULT_GLOB_PATTERN }}
100100 test-results-directory : ' ${{ runner.temp }}/test-results/'
101+ code-coverage-settings-file : ' ${{ github.workspace}}/code-coverage-settings.xml'
101102
102103 - uses : ./.github/actions/test-report
103104 id : test-report
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" utf-8" ?>
2+ <Configuration >
3+ <CodeCoverage >
4+ <!-- Match assembly file paths: -->
5+ <ModulePaths >
6+ <IncludeDirectories >
7+ <Directory >src/**</Directory >
8+ </IncludeDirectories >
9+ </ModulePaths >
10+
11+ <!-- Match attributes on any code element: -->
12+ <Attributes >
13+ <Exclude >
14+ <!-- Don't forget "Attribute" at the end of the name -->
15+ <Attribute >^System\.Diagnostics\.DebuggerHiddenAttribute$</Attribute >
16+ <Attribute >^System\.Diagnostics\.DebuggerNonUserCodeAttribute$</Attribute >
17+ <Attribute >^System\.CodeDom\.Compiler\.GeneratedCodeAttribute$</Attribute >
18+ <Attribute >^System\.Diagnostics\.CodeAnalysis\.ExcludeFromCodeCoverageAttribute$</Attribute >
19+ </Exclude >
20+ </Attributes >
21+
22+ <EnableStaticManagedInstrumentation >True</EnableStaticManagedInstrumentation >
23+ <EnableDynamicManagedInstrumentation >True</EnableDynamicManagedInstrumentation >
24+
25+ </CodeCoverage >
26+ </Configuration >
You can’t perform that action at this time.
0 commit comments