@@ -3,8 +3,10 @@ on: [push, pull_request]
3
3
4
4
env :
5
5
PATH_TO_TEST_RUNNER : test/partiql-tests-runner
6
- CONFORMANCE_REPORT_NAME : conformance_test_results.ion
6
+ CONFORMANCE_REPORT_RELATIVE_PATH : build/conformance-test-report
7
7
COMPARISON_REPORT_NAME : comparison_report.md
8
+ COMPARISON_REPORT_NAME_WITH_LIMIT : comparison_report_limited.md
9
+ COMMENT_SIZE_LIMIT : 10
8
10
9
11
jobs :
10
12
conformance-report :
13
15
steps :
14
16
- uses : actions/checkout@v3
15
17
with :
18
+ ref : ${{ github.event.pull_request.head.sha }}
16
19
submodules : recursive
17
20
- name : Use Java 17
18
21
uses : actions/setup-java@v3
@@ -27,12 +30,12 @@ jobs:
27
30
# Run the conformance tests and save to an Ion file.
28
31
- name : gradle test of the conformance tests (can fail) and save to Ion file
29
32
continue-on-error : true
30
- run : gradle :test:partiql-tests-runner:test --tests "*ConformanceTestReport" -PconformanceReport
33
+ run : gradle :test:partiql-tests-runner:generateTestReport
31
34
# Upload conformance report for future viewing and comparison with future runs.
32
- - name : Upload `conformance_test_results.ion`
35
+ - name : Upload `conformance-test-report` folder
33
36
uses : actions/upload-artifact@v3
34
37
with :
35
- path : ${{ env.PATH_TO_TEST_RUNNER }}/${{ env.CONFORMANCE_REPORT_NAME }}
38
+ path : ${{ env.PATH_TO_TEST_RUNNER }}/build/conformance-test-report
36
39
# Cache the conformance report for `conformance-report-comparison` job (pull_request event only)
37
40
- name : Cache conformance report and build
38
41
if : github.event_name == 'pull_request'
@@ -86,23 +89,34 @@ jobs:
86
89
continue-on-error : true
87
90
run : |
88
91
cd ${{ github.event.pull_request.base.sha }}
89
- gradle :test:partiql-tests-runner:test --tests "*ConformanceTestReport" -PconformanceReport
92
+ gradle :test:partiql-tests-runner:generateTestReport
90
93
- name : (If download of target branch conformance report fails) Move conformance test report of target branch to ./artifact directory
91
94
if : ${{ steps.download-report.outcome == 'failure' }}
92
95
continue-on-error : true
93
96
run : |
94
97
mkdir -p $GITHUB_WORKSPACE/artifact
95
- cp -r $GITHUB_WORKSPACE/${{ github.event.pull_request.base.sha }}/$PATH_TO_TEST_RUNNER/$CONFORMANCE_REPORT_NAME $GITHUB_WORKSPACE/artifact/$CONFORMANCE_REPORT_NAME
98
+ cp -r $GITHUB_WORKSPACE/${{ github.event.pull_request.base.sha }}/$PATH_TO_TEST_RUNNER/$CONFORMANCE_REPORT_RELATIVE_PATH $GITHUB_WORKSPACE/artifact/$CONFORMANCE_REPORT_RELATIVE_PATH
96
99
# Run conformance report comparison. Generates `comparison_report.md`
97
- - name : Run conformance report comparison. Generates `comparison_report.md`
100
+ - name : Run conformance report comparison for artifact . Generates `comparison_report.md`
98
101
continue-on-error : true
99
102
run : |
100
- ARGS="$GITHUB_WORKSPACE/artifact/$CONFORMANCE_REPORT_NAME $CONFORMANCE_REPORT_NAME ${{ github.event.pull_request.base.sha }} $GITHUB_SHA $COMPARISON_REPORT_NAME"
103
+ ARGS="$GITHUB_WORKSPACE/artifact $CONFORMANCE_REPORT_RELATIVE_PATH ${{ github.event.pull_request.base.sha }} $GITHUB_SHA $COMPARISON_REPORT_NAME"
101
104
gradle :test:partiql-tests-runner:run --args="$ARGS"
102
105
# Print conformance report to GitHub actions workflow summary page
103
106
- name : Print markdown in run
104
107
continue-on-error : true
105
108
run : cat $PATH_TO_TEST_RUNNER/$COMPARISON_REPORT_NAME >> $GITHUB_STEP_SUMMARY
109
+ # Upload the full comparison report to CI artifact
110
+ - name : Upload `comparison_report.md`
111
+ uses : actions/upload-artifact@v3
112
+ with :
113
+ path : ${{ env.PATH_TO_TEST_RUNNER }}/comparison_report.md
114
+ # Rebuild the test report with a size limit for comment
115
+ - name : Run conformance report comparison for comment. Generates `comparison_report_limited.md`
116
+ continue-on-error : true
117
+ run : |
118
+ ARGS="$GITHUB_WORKSPACE/artifact $CONFORMANCE_REPORT_RELATIVE_PATH ${{ github.event.pull_request.base.sha }} $GITHUB_SHA $COMPARISON_REPORT_NAME_WITH_LIMIT $COMMENT_SIZE_LIMIT"
119
+ gradle :test:partiql-tests-runner:run --args="$ARGS"
106
120
# Find comment w/ conformance comparison if previous comment published
107
121
- name : Find Comment
108
122
uses : peter-evans/find-comment@v2
@@ -119,5 +133,5 @@ jobs:
119
133
with :
120
134
comment-id : ${{ steps.fc.outputs.comment-id }}
121
135
issue-number : ${{ github.event.pull_request.number }}
122
- body-file : ${{ env.PATH_TO_TEST_RUNNER }}/${{ env.COMPARISON_REPORT_NAME }}
136
+ body-file : ${{ env.PATH_TO_TEST_RUNNER }}/${{ env.COMPARISON_REPORT_NAME_WITH_LIMIT }}
123
137
edit-mode : replace
0 commit comments