Skip to content

Commit 6013c63

Browse files
authored
Upload check-ci and long-check-ci results as artifacts (deephaven#547)
Setup publish job as separate workflow.
1 parent c76e6e7 commit 6013c63

File tree

4 files changed

+104
-14
lines changed

4 files changed

+104
-14
lines changed

.github/workflows/check-ci.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,9 @@ jobs:
3535
arguments: --scan quick
3636
gradle-version: wrapper
3737

38-
- name: Publish Test Results
39-
uses: scacap/action-surefire-report@v1
38+
- name: Upload Test Results
39+
uses: actions/upload-artifact@v2
4040
if: always()
41-
env:
42-
NODE_OPTIONS: '--max_old_space_size=4096'
4341
with:
44-
check_name: check-ci test report
45-
github_token: ${{ secrets.GITHUB_TOKEN }}
46-
report_paths: '**/build/test-results/test/TEST-*.xml'
42+
name: check-ci-results
43+
path: '**/build/test-results/test/TEST-*.xml'

.github/workflows/long-check-ci.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,9 @@ jobs:
3434
arguments: --scan --continue check
3535
gradle-version: wrapper
3636

37-
- name: Publish Test Results
38-
uses: scacap/action-surefire-report@v1
37+
- name: Upload Test Results
38+
uses: actions/upload-artifact@v2
3939
if: always()
40-
env:
41-
NODE_OPTIONS: '--max_old_space_size=4096'
4240
with:
43-
check_name: long-check-ci test report
44-
github_token: ${{ secrets.GITHUB_TOKEN }}
45-
report_paths: '**/build/test-results/test/TEST-*.xml'
41+
name: long-check-ci-results
42+
path: '**/build/test-results/test/TEST-*.xml'
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Publish Check CI results
2+
3+
# WARNING:
4+
# workflow_run provides read-write repo token and access to secrets.
5+
# Do *not* merge changes to this file without the proper review.
6+
# We should only be running trusted code here.
7+
on:
8+
workflow_run:
9+
workflows: ["Check CI"]
10+
types:
11+
- completed
12+
13+
jobs:
14+
# Job based on https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
15+
publish-check-ci:
16+
runs-on: ubuntu-20.04
17+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
18+
steps:
19+
# Unfortunately, the official actions/download-artifact action is very limited in scope.
20+
# Can't use it yet in this context, https://github.com/actions/download-artifact/issues/60
21+
- name: Download artifact
22+
uses: actions/github-script@v3.1.1
23+
with:
24+
script: |
25+
var artifacts = await github.actions.listWorkflowRunArtifacts({
26+
owner: context.repo.owner,
27+
repo: context.repo.repo,
28+
run_id: ${{ github.event.workflow_run.id }},
29+
});
30+
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
31+
return artifact.name == "check-ci-results"
32+
})[0];
33+
var download = await github.actions.downloadArtifact({
34+
owner: context.repo.owner,
35+
repo: context.repo.repo,
36+
artifact_id: matchArtifact.id,
37+
archive_format: 'zip',
38+
});
39+
var fs = require('fs');
40+
fs.writeFileSync('${{github.workspace}}/check-ci-results.zip', Buffer.from(download.data));
41+
- run: unzip check-ci-results.zip
42+
- name: Publish Test Results
43+
uses: scacap/action-surefire-report@v1.0.9
44+
env:
45+
NODE_OPTIONS: '--max_old_space_size=4096'
46+
with:
47+
check_name: check-ci test report
48+
report_paths: '**/build/test-results/test/TEST-*.xml'
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Publish Long CI results
2+
3+
# WARNING:
4+
# workflow_run provides read-write repo token and access to secrets.
5+
# Do *not* merge changes to this file without the proper review.
6+
# We should only be running trusted code here.
7+
on:
8+
workflow_run:
9+
workflows: ["Long Check CI"]
10+
types:
11+
- completed
12+
13+
jobs:
14+
# Job based on https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
15+
publish-long-check-ci:
16+
runs-on: ubuntu-20.04
17+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
18+
steps:
19+
# Unfortunately, the official actions/download-artifact action is very limited in scope.
20+
# Can't use it yet in this context, https://github.com/actions/download-artifact/issues/60
21+
- name: Download artifact
22+
uses: actions/github-script@v3.1.1
23+
with:
24+
script: |
25+
var artifacts = await github.actions.listWorkflowRunArtifacts({
26+
owner: context.repo.owner,
27+
repo: context.repo.repo,
28+
run_id: ${{ github.event.workflow_run.id }},
29+
});
30+
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
31+
return artifact.name == "long-check-ci-results"
32+
})[0];
33+
var download = await github.actions.downloadArtifact({
34+
owner: context.repo.owner,
35+
repo: context.repo.repo,
36+
artifact_id: matchArtifact.id,
37+
archive_format: 'zip',
38+
});
39+
var fs = require('fs');
40+
fs.writeFileSync('${{github.workspace}}/long-check-ci-results.zip', Buffer.from(download.data));
41+
- run: unzip long-check-ci-results.zip
42+
- name: Publish Test Results
43+
uses: scacap/action-surefire-report@v1.0.9
44+
env:
45+
NODE_OPTIONS: '--max_old_space_size=4096'
46+
with:
47+
check_name: long-check-ci test report
48+
report_paths: '**/build/test-results/test/TEST-*.xml'

0 commit comments

Comments
 (0)