-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yaml
76 lines (63 loc) · 2.08 KB
/
action.yaml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: 'junit_summary'
description: 'Generate a summary from a jUnit report. This summary shows in the workflow summary page. Exit code is number of failed tests.'
inputs:
junit_reports_dir:
description: 'Path to directory containing XML files with the jUnit reports'
required: true
print_summary:
description: 'Whether to print the summary (Default: True)'
required: false
default: 'True'
show_failed:
description: 'Whether to show the list of failed tests (Default: True)'
required: false
default: 'True'
show_disabled:
description: 'Whether to show the list of disabled tests (Default: False)'
required: false
default: 'False'
show_skipped:
description: 'Whether to show the list of skipped tests (Default: False)'
required: false
default: 'False'
runs:
using: composite
steps:
- name: jUnit Summary
id: junit_summary
shell: bash
run: |
OUTPUT_FILE_OPTION="--output-file $GITHUB_STEP_SUMMARY"
PRINT_SUMMARY_OPTION=""
if [[ "${{ inputs.print_summary }}" == "True" ]]
then
PRINT_SUMMARY_OPTION="--print-summary"
fi
SHOW_FAILED_OPTION=""
if [[ "${{ inputs.show_failed }}" == "True" ]]
then
SHOW_FAILED_OPTION="--show-failed"
fi
SHOW_DISABLED_OPTION=""
if [[ "${{ inputs.show_disabled }}" == "True" ]]
then
SHOW_DISABLED_OPTION="--show-disabled"
fi
SHOW_SKIPPED_OPTION=""
if [[ "${{ inputs.show_skipped }}" == "True" ]]
then
SHOW_SKIPPED_OPTION="--show-skipped"
fi
EXIT_CODE=0
for JUNIT_REPORT in ${{ inputs.junit_reports_dir }}/*.xml
do
python3 ${{ github.action_path }}/../../resources/junit_summary.py \
--junit-report ${JUNIT_REPORT} \
${OUTPUT_FILE_OPTION} \
${PRINT_SUMMARY_OPTION} \
${SHOW_FAILED_OPTION} \
${SHOW_DISABLED_OPTION} \
${SHOW_SKIPPED_OPTION}
EXIT_CODE=$((${EXIT_CODE} + $?))
done
exit ${EXIT_CODE}