]> begriffs open source - cmsis/blob - .github/workflows/corevalidation-report.yml
Enhance TrustZone conditions in pack description
[cmsis] / .github / workflows / corevalidation-report.yml
1 name: Publish CoreValidation Test Results
2
3 on:
4   workflow_run:
5     workflows: ["CoreValidation"]
6     branches-ignore: ["develop"]
7     types:
8       - completed
9
10 jobs:
11   publish-test-results:
12     name: Publish CoreValidation Test Results
13     runs-on: ubuntu-latest
14     permissions:
15       contents: read
16       issues: read
17       checks: write
18       pull-requests: write
19     if: github.event.workflow_run.conclusion != 'skipped'
20
21     steps:
22       - name: Download test results
23         env:
24           GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
25         run: |
26            mkdir -p artifacts && cd artifacts
27
28            artifacts_url=${{ github.event.workflow_run.artifacts_url }}
29
30            gh api "$artifacts_url" -q '.artifacts[] | select(.name=="tests" or .name=="EventFile") | [.name, .archive_download_url] | @tsv' | \
31            while read artifact; do
32              IFS=$'\t' read name url <<< "$artifact"
33              gh api $url > "$name.zip"
34              unzip -d "$name" "$name.zip"
35            done
36
37       - name: Publish Test Results
38         uses: EnricoMi/publish-unit-test-result-action@v2
39         with:
40           commit: ${{ github.event.workflow_run.head_sha }}
41           event_file: artifacts/EventFile/event.json
42           report_individual_runs: true
43           event_name: ${{ github.event.workflow_run.event }}
44           junit_files: "artifacts/**/*.junit"