Refactor publish-report to merge JUnit files into single report for HTML generation; remove Maven cache step from setup-java-maven.
Build and Analyse / build-and-analyse (push) Successful in 46s

This commit is contained in:
2026-06-27 15:10:19 +02:00
parent 5ed9da4036
commit 0acf0d0834
2 changed files with 16 additions and 22 deletions
+16 -14
View File
@@ -24,30 +24,32 @@ runs:
cp "$f" "junit-short/${short}" cp "$f" "junit-short/${short}"
done done
- name: Publish Test Report
uses: dorny/test-reporter@v3
with:
name: ${{ inputs.report-name }}
path: "*"
reporter: java-junit
only-summary: true
working-directory: "junit-short"
use-actions-summary: true
token: ${{ inputs.token }}
- name: Generate HTML Report - name: Generate HTML Report
shell: bash shell: bash
run: | run: |
pip install junit2html --quiet pip install junit2html --quiet
python3 - <<'EOF'
import glob, xml.etree.ElementTree as ET
files = glob.glob("junit-short/*.xml")
root = ET.Element("testsuites")
for f in files:
tree = ET.parse(f)
r = tree.getroot()
if r.tag == "testsuites":
root.extend(r)
else:
root.append(r)
ET.ElementTree(root).write("junit-short/merged.xml")
EOF
mkdir -p reports mkdir -p reports
junit2html junit-short/*.xml reports/index.html junit2html junit-short/merged.xml reports/index.html
- name: Commit Report to Repo - name: Commit Report to Repo
shell: bash shell: bash
env: env:
GIT_USER: gitea-actions-bot GIT_USER: gitea-actions-bot
GIT_EMAIL: osp@thischwa.codes GIT_EMAIL: bot@mein-gateway.de
GITEA_TOKEN: ${{ secrets.REPORT_TOKEN }} GITEA_TOKEN: ${{ inputs.token }}
run: | run: |
git config user.name "$GIT_USER" git config user.name "$GIT_USER"
git config user.email "$GIT_EMAIL" git config user.email "$GIT_EMAIL"
@@ -19,11 +19,3 @@ runs:
distribution: ${{ inputs.java-distribution }} distribution: ${{ inputs.java-distribution }}
java-version: ${{ inputs.java-version }} java-version: ${{ inputs.java-version }}
uses: actions/setup-java@v5 uses: actions/setup-java@v5
- name: Cache Maven Repository
uses: actions/cache@v5
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-