name: Server CI Report on: workflow_run: workflows: - "Server CI PR" - "Server CI Master" types: - completed jobs: generate-report-matrix: runs-on: ubuntu-22.04 outputs: REPORT_MATRIX: ${{ steps.report.outputs.REPORT_MATRIX }} steps: - name: report/download-artifacts-from-PR-workflow uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: run-id: ${{ github.event.workflow_run.id }} github-token: ${{ github.token }} pattern: "*-test-logs" path: reports - name: report/validate-and-prepare-data id: validate run: | # Create validated data file > /tmp/validated-tests.json find "reports" -type f -name "test-name" | while read -r test_file; do folder=$(basename "$(dirname "$test_file")") test_name_raw=$(cat "$test_file" | tr -d '\n\r') # Validate test name: allow alphanumeric, spaces, hyphens, underscores, parentheses, and dots if [[ "$test_name_raw" =~ ^[a-zA-Z0-9\ \(\)_.-]+$ ]] && [[ ${#test_name_raw} -le 100 ]]; then # Use jq to safely escape the test name as JSON test_name_escaped=$(echo -n "$test_name_raw" | jq -R .) echo "{\"artifact\": \"$folder\", \"name\": $test_name_escaped}" >> /tmp/validated-tests.json else echo "Warning: Skipping invalid test name in $test_file: '$test_name_raw'" >&2 fi done # Verify we have at least some valid tests if [[ ! -s /tmp/validated-tests.json ]]; then echo "Error: No valid test names found" >&2 exit 1 fi - name: report/generate-report-matrix id: report run: | # Convert validated JSON objects to matrix format jq -s '{ "test": . }' /tmp/validated-tests.json | tee /tmp/report-matrix echo REPORT_MATRIX=$(cat /tmp/report-matrix | jq --compact-output --monochrome-output) >> ${GITHUB_OUTPUT} publish-report: runs-on: ubuntu-22.04 name: Publish Report ${{ matrix.test.name }} needs: - generate-report-matrix permissions: pull-requests: write checks: write issues: write strategy: matrix: ${{ fromJson(needs.generate-report-matrix.outputs.REPORT_MATRIX) }} steps: - name: report/download-artifacts-from-PR-workflow uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: run-id: ${{ github.event.workflow_run.id }} github-token: ${{ github.token }} name: ${{ matrix.test.artifact }} path: ${{ matrix.test.artifact }} - name: report/fetch-pr-number if: github.event.workflow_run.name == 'Server CI PR' id: incoming-pr env: ARTIFACT: "${{ matrix.test.artifact }}" run: | if [[ -f "$ARTIFACT/pr-number" ]]; then pr_number=$(cat "$ARTIFACT/pr-number" | tr -d '\n\r' | grep -E '^[0-9]+$') if [[ -n "$pr_number" ]] && [[ ${#pr_number} -le 10 ]]; then echo "NUMBER=$pr_number" >> ${GITHUB_OUTPUT} else echo "Invalid PR number format" >&2 exit 1 fi else echo "PR number file not found" >&2 exit 1 fi - name: Publish test report id: report uses: mikepenz/action-junit-report@cf701569b05ccdd861a76b8607a66d76f6fd4857 # v5.5.1 with: report_paths: ${{ matrix.test.artifact }}/report.xml check_name: ${{ matrix.test.name }} (Results) job_name: ${{ matrix.test.name }} commit: ${{ github.event.workflow_run.head_commit.id }} require_tests: true check_retries: true flaky_summary: true include_passed: true check_annotations: true - name: Report retried tests (pull request) uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 if: ${{ steps.report.outputs.flaky_summary != '
| Test | Retries |
|---|