Skip to content

Commit bc0db52

Browse files
author
Petr Sramek
committed
lets tryyyyyy
1 parent ed89830 commit bc0db52

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

.github/actions/test/action.yml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ inputs:
2222
description: 'Path to the test runsettings file. Default: '''''
2323
required: false
2424
default: ''
25-
test-result-logger:
26-
description: 'Test result logger. Default: trx'
25+
use-trf-logger:
26+
description: 'Use TRX logger. Default: true'
2727
required: false
28-
default: 'trx'
28+
default: 'true'
2929
collect-code-coverage:
3030
description: 'Collect code coverage. Default: true'
3131
required: false
@@ -47,9 +47,9 @@ inputs:
4747
description: 'Test artifacts name, Default: test-results'
4848
required: false
4949
default: 'test-results'
50-
51-
runs:
52-
using: "composite"
50+
51+
runs:
52+
using: composite
5353
steps:
5454
- name: 'Checkout ${{ github.head_ref || github.ref }}'
5555
uses: actions/checkout@v4
@@ -58,13 +58,24 @@ runs:
5858
uses: actions/setup-dotnet@v4
5959
with:
6060
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
6166

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+
6277
- name: 'Test with .NET CLI'
6378
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)' || '' }}
6879
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 }}
6980

7081
- name: 'Upload test results'

0 commit comments

Comments
 (0)