From 0acf0d0834475957397feb2b98b1fab729fce31d Mon Sep 17 00:00:00 2001 From: Thilo Schwarz Date: Sat, 27 Jun 2026 15:10:19 +0200 Subject: [PATCH] Refactor `publish-report` to merge JUnit files into single report for HTML generation; remove Maven cache step from `setup-java-maven`. --- .github/actions/publish-report/action.yml | 30 +++++++++++---------- .github/actions/setup-java-maven/action.yml | 8 ------ 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/.github/actions/publish-report/action.yml b/.github/actions/publish-report/action.yml index e905ec1..31b1ef9 100644 --- a/.github/actions/publish-report/action.yml +++ b/.github/actions/publish-report/action.yml @@ -24,30 +24,32 @@ runs: cp "$f" "junit-short/${short}" 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 shell: bash run: | 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 - junit2html junit-short/*.xml reports/index.html + junit2html junit-short/merged.xml reports/index.html - name: Commit Report to Repo shell: bash env: GIT_USER: gitea-actions-bot - GIT_EMAIL: osp@thischwa.codes - GITEA_TOKEN: ${{ secrets.REPORT_TOKEN }} + GIT_EMAIL: bot@mein-gateway.de + GITEA_TOKEN: ${{ inputs.token }} run: | git config user.name "$GIT_USER" git config user.email "$GIT_EMAIL" diff --git a/.github/actions/setup-java-maven/action.yml b/.github/actions/setup-java-maven/action.yml index cb037ba..d1e1012 100644 --- a/.github/actions/setup-java-maven/action.yml +++ b/.github/actions/setup-java-maven/action.yml @@ -19,11 +19,3 @@ runs: distribution: ${{ inputs.java-distribution }} java-version: ${{ inputs.java-version }} 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- \ No newline at end of file