Skip to content

Commit d21e6a6

Browse files
authored
adding new workflow to publish test results (Netflix#172)
Co-authored-by: Sundaram Ananthanarayanan <[email protected]>
1 parent 6f42639 commit d21e6a6

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ end_of_line = lf
1111
charset = utf-8
1212
trim_trailing_whitespace = true
1313
insert_final_newline = true
14+
15+
[*.{yml,yaml}]
16+
indent_size = 2

.github/workflows/test-results.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Unit Test Results
2+
on:
3+
workflow_run:
4+
workflows: [ "CI" ]
5+
types:
6+
- completed
7+
8+
jobs:
9+
unit-test-results:
10+
name: Unit Test Results
11+
runs-on: ubuntu-latest
12+
if: github.event.workflow_run.conclusion != 'skipped'
13+
14+
steps:
15+
- name: Download and Extract Artifacts
16+
env:
17+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
18+
run: |
19+
mkdir -p artifacts && cd artifacts
20+
21+
artifacts_url=${{ github.event.workflow_run.artifacts_url }}
22+
23+
gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact
24+
do
25+
IFS=$'\t' read name url <<< "$artifact"
26+
gh api $url > "$name.zip"
27+
unzip -d "$name" "$name.zip"
28+
done
29+
30+
- name: Publish Unit Test Results
31+
uses: EnricoMi/publish-unit-test-result-action@v1
32+
with:
33+
commit: ${{ github.event.workflow_run.head_sha }}
34+
event_file: artifacts/Event File/event.json
35+
event_name: ${{ github.event.workflow_run.event }}
36+
files: "artifacts/**/*.xml"

0 commit comments

Comments
 (0)