84
84
key : ${{ github.sha }}
85
85
# Conformance report generation and comparison report generation job will run only after the `Build and Test` job
86
86
# succeeds.
87
- conformance :
88
- name : Check conformance
87
+ conformance-report :
88
+ name : Create conformance report for `push` and `pull_request` events
89
89
runs-on : ubuntu-latest
90
90
needs : [build]
91
91
steps :
@@ -118,6 +118,35 @@ jobs:
118
118
uses : actions/upload-artifact@v3
119
119
with :
120
120
path : cts_report.json
121
+ # Cache the `cargo build` and conformance report for `conformance-report-comparison` job (pull_request event only)
122
+ - name : Cache `cargo build` and conformance report
123
+ if : github.event_name == 'pull_request'
124
+ uses : actions/cache@v2
125
+ id : restore-build-and-conformance
126
+ with :
127
+ path : ./*
128
+ key : ${{ github.sha }}-conformance-report
129
+ conformance-report-comparison :
130
+ name : Create comparison report for `pull_request` event
131
+ runs-on : ubuntu-latest
132
+ needs : [conformance-report]
133
+ if : github.event_name == 'pull_request'
134
+ steps :
135
+ # Pull down cached `cargo build` and conformance report
136
+ - uses : actions/checkout@v2
137
+ with :
138
+ submodules : recursive
139
+ - name : Rust Toolchain
140
+ uses : actions-rs/toolchain@v1
141
+ with :
142
+ profile : minimal
143
+ toolchain : stable
144
+ override : true
145
+ - uses : actions/cache@v2
146
+ id : restore-build-and-conformance
147
+ with :
148
+ path : ./*
149
+ key : ${{ github.sha }}-conformance-report
121
150
# Download conformance report from `main` to create comparison report. If `main` has no report, use a backup
122
151
# report (stored in partiql-conformance-tests/backup_conformance_report.json). Alternatively, we could consider
123
152
# - pulling `main` branch and rerun the tests
@@ -143,7 +172,6 @@ jobs:
143
172
- name : Find Comment
144
173
uses : peter-evans/find-comment@v2
145
174
id : fc
146
- if : github.event_name == 'pull_request'
147
175
with :
148
176
issue-number : ${{ github.event.pull_request.number }}
149
177
comment-author : ' github-actions[bot]'
@@ -159,7 +187,6 @@ jobs:
159
187
# Create or update (if previous comment exists) with markdown version of comparison report
160
188
- name : Create or update comment
161
189
uses : peter-evans/create-or-update-comment@v2
162
- if : github.event_name == 'pull_request'
163
190
with :
164
191
comment-id : ${{ steps.fc.outputs.comment-id }}
165
192
issue-number : ${{ github.event.pull_request.number }}
0 commit comments