Skip to content

junit report

junit report #260

Workflow file for this run

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: junit report
on:
workflow_run:
workflows: [master pull request ci]
types: [completed]
concurrency:
group: junit-report-${{ github.event.workflow_run.pull_requests[0].number || github.event.workflow_run.head_sha }}
cancel-in-progress: true
permissions:
actions: read
checks: write
contents: read
issues: write
pull-requests: write
jobs:
checks:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'temurin'
- name: Download Test Report (Ubuntu JDK 17)
uses: dawidd6/action-download-artifact@v21
with:
name: junit-test-results-ubuntu-latest-jdk17
workflow: master-build.yml
run_id: ${{ github.event.workflow_run.id }}
path: ./junit-ubuntu-jdk17
- name: Verify JUnit XML layout
run: |
set -euo pipefail
shopt -s globstar nullglob
root="./junit-ubuntu-jdk17"
if [ ! -d "$root" ]; then
echo "::error::Download path $root is missing."
exit 1
fi
files=("$root"/build/**/TEST-*.xml)
if [ ${#files[@]} -eq 0 ] || [ ! -e "${files[0]}" ]; then
echo "::error::No TEST-*.xml under $root/build/ (artifact missing, wrong layout, or download failed)."
find "$root" -maxdepth 5 -type d -print 2>/dev/null | head -80 || true
exit 1
fi
echo "Found ${#files[@]} JUnit report file(s) under $root/build/."
- name: Resolve PR number
id: pr
run: |
PR_NUMBER="${{ github.event.workflow_run.pull_requests[0].number }}"
if [ -z "$PR_NUMBER" ]; then
PR_NUMBER=$(gh api \
"repos/${{ github.repository }}/commits/${{ github.event.workflow_run.head_sha }}/pulls" \
--jq '.[0].number // empty')
fi
echo "number=${PR_NUMBER:-}" >> "$GITHUB_OUTPUT"
if [ -n "$PR_NUMBER" ]; then
echo "has_pr=true" >> "$GITHUB_OUTPUT"
else
echo "has_pr=false" >> "$GITHUB_OUTPUT"
fi
env:
GH_TOKEN: ${{ github.token }}
- name: Publish Test Report
uses: mikepenz/action-junit-report@v6
with:
report_paths: ./junit-ubuntu-jdk17/build/**/TEST-*.xml
check_name: JUnit Test Report
commit: ${{ github.event.workflow_run.head_sha }}
fail_on_failure: false
fail_on_parse_error: true
require_tests: true
require_passed_tests: true
include_passed: false
include_skipped: true
check_annotations: true
annotate_notice: true
job_summary: true
detailed_summary: true
flaky_summary: true
skip_success_summary: true
include_time_in_summary: true
group_suite: true
comment: ${{ steps.pr.outputs.has_pr == 'true' }}
updateComment: ${{ steps.pr.outputs.has_pr == 'true' }}
skip_comment_without_tests: true
job_name: tests
truncate_stack_traces: false
annotations_limit: 50
pr_id: ${{ steps.pr.outputs.number }}