-
Notifications
You must be signed in to change notification settings - Fork 11
100 lines (81 loc) · 2.75 KB
/
ci.yml
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: CI Job to Generate JUnit Reports with Diff
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
generate-reports:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install junit2html
run: |
pip install junit2html
- name: Make Shell Script Executable
run: chmod +x scripts/run_commit_tests.sh
- name: Run Shell Script to Generate Input File
run: |
./scripts/run_commit_tests.sh
- name: Run JUnit Report Generation Script
run: |
python scripts/into_junit.py /tmp/SHARED.UNITS > junit.xml
- name: Convert JUnit XML to Standard HTML Report
continue-on-error: true # Continue to the next step even if this one fails
run: |
junit2html junit.xml junit-standard-report.html
- name: Convert JUnit XML to Matrix HTML Report
continue-on-error: true # Continue to the next step even if this one fails
run: |
junit2html --report-matrix junit-matrix-report.html junit.xml
- name: Upload JUnit XML Report
uses: actions/upload-artifact@v3
with:
name: junit-report
path: junit.xml
- name: Upload Standard HTML Report
uses: actions/upload-artifact@v3
with:
name: junit-standard-html-report
path: junit-standard-report.html
- name: Upload Matrix HTML Report
uses: actions/upload-artifact@v3
with:
name: junit-matrix-html-report
path: junit-matrix-report.html
- name: Display JUnit Test Results
uses: dorny/test-reporter@v1
with:
name: 'JUnit Results'
path: 'junit.xml'
reporter: 'java-junit' # Correct reporter type for JUnit XML
fail-on-error: false # Do not fail the job if tests fail
- name: Download Previous JUnit Results
uses: actions/download-artifact@v3
with:
name: junit-report
path: previous-junit.xml # Save as previous-junit.xml
- name: Install ReportGenerator
run: |
dotnet tool install -g dotnet-reportgenerator-globaltool
- name: Compare JUnit Test Results with ReportGenerator
run: |
reportgenerator \
-reports:"previous-junit.xml;junit.xml" \
-targetdir:"./comparison-report" \
-reporttypes:"HtmlSummary;HtmlChart"
- name: Upload JUnit Comparison Report
uses: actions/upload-artifact@v3
with:
name: junit-comparison-html-report
path: ./comparison-report
- name: Display HTML Report Information
run: |
echo "Standard, matrix, and comparison HTML reports are available as artifacts."