name: 'Test Report'
permissions: read-all

on:
  workflow_run:
    workflows: [ build ]
    types: [ completed ]
    branches: [ master, v2.dev, v3.dev ]

jobs:
  report:
    runs-on: ubuntu-latest
    permissions:
      checks: write
    if: github.event.workflow_run.conclusion != 'skipped'
    steps:
    - name: Download and Extract Artifacts
      env:
        GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
      run: |
        mkdir -p artifacts && cd artifacts
        artifacts_url=${{ github.event.workflow_run.artifacts_url }}
        gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact
        do
          IFS=$'\t' read name url <<< "$artifact"
          gh api $url > "$name.zip"
          unzip -d "$name" "$name.zip"
        done
    - name: Truncate test results
      run: find . -type f -name '*.xml' -exec sh -c 'grep testsuite {} > {}.out && mv {}.out {}' \;
    - name: Publish Unit Test Results
      uses: EnricoMi/publish-unit-test-result-action@v1
      with:
        commit: ${{ github.event.workflow_run.head_sha }}
        event_name: ${{ github.event.workflow_run.event }}
        event_file: artifacts/Event File/event.json
        check_run_annotations: none
        comment_mode: off
        files: '**/*.xml'

name: 'Test Report'
permissions: read-all

on:
  workflow_run:
    workflows: [ build ]
    types: [ completed ]
    branches: [ master, v2.dev, v3.dev ]

jobs:
  report:
    runs-on: ubuntu-latest
    permissions:
      checks: write
    if: github.event.workflow_run.conclusion != 'skipped'
    steps:
    - name: Download and Extract Artifacts
      env:
        GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
      run: |
        mkdir -p artifacts && cd artifacts
        artifacts_url=${{ github.event.workflow_run.artifacts_url }}
        gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact
        do
          IFS=$'\t' read name url <<< "$artifact"
          gh api $url > "$name.zip"
          unzip -d "$name" "$name.zip"
        done
    - name: Publish Unit Test Results
      uses: EnricoMi/publish-unit-test-result-action@v1
      with:
        commit: ${{ github.event.workflow_run.head_sha }}
        event_name: ${{ github.event.workflow_run.event }}
        event_file: artifacts/Event File/event.json
        comment_mode: off
        ignore_runs: true
        files: '**/*.xml'

Update test-result action for large suite support
Update test-result action for large suite support

https://github.com/EnricoMi/publish-unit-test-result-action/issues/231
