-
Notifications
You must be signed in to change notification settings - Fork 10
82 lines (79 loc) · 3.21 KB
/
ci-publish-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Publish test results
on:
workflow_run:
workflows: ["Build and test"]
types:
- completed
jobs:
publish-test-results:
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion != 'skipped'
steps:
# https://github.com/LouisBrunner/checks-action/issues/22#issuecomment-885047551
- name: Recognize sha ref
id: sharef
run: |
if [ "$EVENT" == 'workflow_run' ]
then
echo "::set-output name=sha::$(echo ${{github.event.workflow_run.head_sha}})"
fi
env:
EVENT: ${{ github.event_name }}
REF: ${{ github.ref }}
# https://github.com/EnricoMi/publish-unit-test-result-action#support-fork-repositories-and-dependabot-branches
- 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 TypeScript Test Report
uses: EnricoMi/[email protected]
with:
check_name: "Tests: TypeScript"
comment_title: TypeScript Test Report
commit: ${{steps.sharef.outputs.sha}}
deduplicate_classes_by_file_name: false
files: artifacts/ts-test-results/**/*.xml
github_token: ${{ secrets.GITHUB_TOKEN }}
hide_comments: all but latest
report_individual_runs: true
- name: Publish Android Unit Test Report
uses: EnricoMi/[email protected]
with:
check_name: "Tests: Android - Unit"
comment_title: Android Unit Test Report
commit: ${{steps.sharef.outputs.sha}}
deduplicate_classes_by_file_name: false
files: artifacts/android-unit-test-results/**/*.xml
github_token: ${{ secrets.GITHUB_TOKEN }}
hide_comments: all but latest
report_individual_runs: true
- name: Publish Android Instrumented Test Report
uses: EnricoMi/[email protected]
with:
check_name: "Tests: Android - Instrumented"
comment_title: Android Instrumented Test Report
commit: ${{steps.sharef.outputs.sha}}
deduplicate_classes_by_file_name: false
files: artifacts/android-instrumented-test-results/**/*.xml
github_token: ${{ secrets.GITHUB_TOKEN }}
hide_comments: all but latest
report_individual_runs: true
- name: Publish iOS Test Report
uses: EnricoMi/[email protected]
with:
check_name: "Tests: iOS"
comment_title: iOS Test Report
commit: ${{steps.sharef.outputs.sha}}
deduplicate_classes_by_file_name: false
files: artifacts/ios-test-results/**/*.xml
github_token: ${{ secrets.GITHUB_TOKEN }}
hide_comments: all but latest
report_individual_runs: true