-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.yml
More file actions
60 lines (51 loc) · 2.06 KB
/
action.yml
File metadata and controls
60 lines (51 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: 'Generate test report with Liquid Test Reports CLI'
author: 'Pete Sramek'
description: 'Run tests, collects code coverage, logs test results, uploads test artifacts'
inputs:
# Required
test-result-folder:
description: 'Folder where test results are stored'
required: true
# Optional
dotnet_sdk_version:
description: '.NET SDK version. Default: 9.x'
required: false
default: '9.x'
test-report-filename:
description: 'Filename of the test report. Default: test-report.md'
required: false
default: 'test-report.md'
outputs:
test-report-file:
description: 'Path to the generated test report'
value: ${{ steps.variables.outputs.test-report-file }}
runs:
using: composite
steps:
- name: 'Checkout ${{ github.head_ref || github.ref }}'
uses: actions/checkout@v5
- name: 'Setup .NET ${{ inputs.dotnet_sdk_version }}'
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ inputs.dotnet_sdk_version }}
- name: Install LiquidTestReports.Cli
shell: bash
run: dotnet tool install --global LiquidTestReports.Cli --prerelease
- if: ${{ endsWith(inputs.test-result-folder, '/') }}
name: 'Set TEST_RESULT_FOLDER environment variable'
shell: bash
run: echo "TEST_RESULT_FOLDER=${{ inputs.test-result-folder }}" >> $GITHUB_ENV
- if: ${{ !endsWith(inputs.test-result-folder, '/') }}
name: 'Set TEST_RESULT_FOLDER environment variable'
shell: bash
run: echo "TEST_RESULT_FOLDER=${{ inputs.test-result-folder }}/" >> $GITHUB_ENV
- name: 'Set TEST_REPORT_FILE environment variable'
shell: bash
run: echo "TEST_REPORT_FILE=${{ env.TEST_RESULT_FOLDER }}${{ inputs.test-report-filename }}" >> $GITHUB_ENV
- name: 'Set test-report-file output'
id: variables
shell: bash
run: echo "test-report-file=${{ env.TEST_REPORT_FILE }}" >> $GITHUB_OUTPUT
- name: Generate test report
shell: bash
run: liquid --inputs "Folder=${{ env.TEST_RESULT_FOLDER }};File=**/*.trx;Format=Trx" --output-file ${{ env.TEST_REPORT_FILE }}