-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (49 loc) · 1.71 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
name: Annotate checks
on:
workflow_run:
workflows: ["Java CI with Maven", "Release with Maven"]
types:
- completed
jobs:
annotate:
if: github.repository_owner == 'nineinchnick'
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 -xeuo pipefail
pwd
ls
for archive in *.zip; do
name=$(basename "$archive" .zip)
mkdir "$name"
(cd "$name" && unzip ../"$archive")
done
# Process unit and integration test reports
- uses: scacap/action-surefire-report@v1
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}}