-
Notifications
You must be signed in to change notification settings - Fork 7
73 lines (66 loc) · 1.92 KB
/
publish-results.yml
File metadata and controls
73 lines (66 loc) · 1.92 KB
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
name: Publish test results
on:
workflow_call:
inputs:
workflow_id:
required: true
type: string
event_name:
required: true
type: string
event_file:
required: true
type: string
commit:
required: true
type: string
permissions:
checks: write
pull-requests: write
contents: read
packages: read
jobs:
publish-test-results:
name: "Publish Tests Results"
runs-on: ubuntu-latest
steps:
- name: Download result files
uses: actions/download-artifact@v7
with:
run-id: ${{ inputs.workflow_id }}
path: artifacts
github-token: ${{ github.token }}
- name: Download result files PR
if: ${{ github.run_id != inputs.workflow_id }}
uses: actions/download-artifact@v7
with:
path: artifacts
github-token: ${{ github.token }}
- name: "List files"
id: listfiles
run: |
echo $GITHUB_WORKSPACE
ls -R $GITHUB_WORKSPACE
if ! find "${{ github.workspace }}/artifacts/" -name '*.xml' -print -quit | grep -q .; then
echo "Error: no .xml files found"
exit 1
fi
- id: app_token
uses: actions/create-github-app-token@v2
if: always()
with:
app-id: 2291458
private-key: ${{ secrets.TEST_REPORTING_APP_TOKEN }}
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: |
always()
&& contains(steps.listfiles.outcome, 'success')
with:
commit: ${{ inputs.commit }}
event_file: ${{ inputs.event_file}}
event_name: ${{ inputs.event_name }}
files: "${{ github.workspace }}/artifacts/**/*.xml"
action_fail: true
action_fail_on_inconclusive: true
github_token: ${{ steps.app_token.outputs.token }}