forked from trinodb/trino
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (61 loc) · 2.18 KB
/
annotate.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
name: Annotate checks
on:
workflow_run:
workflows: ["ci", "docs"]
types:
- completed
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
jobs:
annotate:
if: github.repository_owner == 'trinodb'
runs-on: ubuntu-latest
steps:
- name: 'Download artifact'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const opts = github.rest.actions.listWorkflowRunArtifacts.endpoint.merge({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
const artifacts = await github.paginate(opts);
for (const artifact of artifacts) {
if (!artifact.name.startsWith('test report ')) {
continue;
}
const download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: artifact.id,
archive_format: 'zip',
});
fs.writeFileSync('${{github.workspace}}/' + artifact.name + '.zip', Buffer.from(download.data));
}
- run: |
set -x
pwd
ls
for archive in *.zip; do
# $archive is literally *.zip if there are no zip files matching the glob expression
[ -f "$archive" ] || continue
name=$(basename "$archive" .zip)
mkdir "$name"
(cd "$name" && unzip ../"$archive")
done
# Process unit and integration test reports
- uses: scacap/[email protected]
with:
# this workflow should never fail, as it is not a quality gateway
fail_if_no_tests: false
commit: ${{github.event.workflow_run.head_sha}}
# Process Product Test reports
- uses: starburstdata/[email protected]
with:
# this workflow should never fail, as it is not a quality gateway
fail_if_empty: false
commit: ${{github.event.workflow_run.head_sha}}
github_token: ${{ github.token }}