@@ -22,10 +22,10 @@ inputs:
22
22
description : ' Path to the test runsettings file. Default: '''' '
23
23
required : false
24
24
default : ' '
25
- test-result -logger :
26
- description : ' Test result logger. Default: trx '
25
+ use-trf -logger :
26
+ description : ' Use TRX logger. Default: true '
27
27
required : false
28
- default : ' trx '
28
+ default : ' true '
29
29
collect-code-coverage :
30
30
description : ' Collect code coverage. Default: true'
31
31
required : false
@@ -47,9 +47,9 @@ inputs:
47
47
description : ' Test artifacts name, Default: test-results'
48
48
required : false
49
49
default : ' test-results'
50
-
51
- runs :
52
- using : " composite"
50
+
51
+ runs :
52
+ using : composite
53
53
steps :
54
54
- name : ' Checkout ${{ github.head_ref || github.ref }}'
55
55
uses : actions/checkout@v4
@@ -58,13 +58,24 @@ runs:
58
58
uses : actions/setup-dotnet@v4
59
59
with :
60
60
dotnet-version : ${{ inputs.dotnet_sdk_version }}
61
+
62
+ - if : ${{ inputs.use-trf-logger == 'true' }}
63
+ name : ' Set TRX_LOGGER_ARGS environment variable'
64
+ shell : bash
65
+ run : echo "TRX_LOGGER_ARGS=--report-trx" >> $GITHUB_ENV
61
66
67
+ - if : ${{ inputs.test-runsettings-path != '' }}
68
+ name : ' Set RUN_SETTINGS_ARGS environment variable'
69
+ shell : bash
70
+ run : echo "RUN_SETTINGS_ARGS=${{ inputs.test-runsettings-path }}" >> $GITHUB_ENV
71
+
72
+ - if : ${{ inputs.collect-code-coverage == 'true' }}
73
+ name : ' Set CODE_COVERAGE_ARGS environment variable'
74
+ shell : bash
75
+ run : echo "CODE_COVERAGE_ARGS=---coverage --coverage-output-format ${{ inputs.code-coverage-output-format}}" >> $GITHUB_ENV
76
+
62
77
- name : ' Test with .NET CLI'
63
78
shell : bash
64
- env :
65
- TRX_LOGGER_ARGS : ${{ inputs.test-result-logger != '' && ' --report-trx' || '' }}
66
- RUN_SETTINGS_ARGS : ${{ inputs.test-runsettings-path != '' && '--settings $(inputs.test-runsettings-path)' || '' }}
67
- CODE_COVERAGE_ARGS : ${{ inputs.collect-code-coverage == 'true' && '--coverage --coverage-output-format $(inputs.code-coverage-output-format)' || '' }}
68
79
run : dotnet test ${{ inputs.test-project-glob-pattern }} --configuration ${{ inputs.build-configuration }} --verbosity normal -- ${{ env.CODE_COVERAGE_ARGS }} ${{ env.RUN_SETTINGS_ARGS }} ${{ env.TRX_LOGGER_ARGS }} --results-directory ${{ inputs.test-results-directory }}
69
80
70
81
- name : ' Upload test results'
0 commit comments