@@ -207,11 +207,44 @@ jobs:
207207 event-type : client-sdk-android-push
208208 client-payload : ' {"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
209209
210+ diffuse_prep :
211+ name : Diffuse prep (base AAR cache)
212+ runs-on : ubuntu-latest
213+ if : github.event_name == 'pull_request'
214+ outputs :
215+ base_aar_cache_hit : ${{ steps.diffuse_base_lookup.outputs.cache-hit }}
216+ steps :
217+ - uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
218+ id : diffuse_base_lookup
219+ with :
220+ path : client-sdk-android/diffuse-source-file
221+ key : diffuse-${{ github.event.pull_request.base.sha }}
222+ lookup-only : true
223+
224+ - uses : peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad # v4.0.0
225+ if : steps.diffuse_base_lookup.outputs.cache-hit != 'true' && github.event.pull_request.head.repo.full_name == github.repository
226+ id : find_comment_cache_miss
227+ with :
228+ issue-number : ${{ github.event.pull_request.number }}
229+ body-includes : Diffuse output
230+
231+ - uses : peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
232+ if : steps.diffuse_base_lookup.outputs.cache-hit != 'true' && github.event.pull_request.head.repo.full_name == github.repository
233+ with :
234+ body : |
235+ Diffuse output:
236+
237+ Base AAR cache miss. Please run the build job on main to generate the base AAR.
238+ edit-mode : replace
239+ comment-id : ${{ steps.find_comment_cache_miss.outputs.comment-id }}
240+ issue-number : ${{ github.event.pull_request.number }}
241+ token : ${{ secrets.GITHUB_TOKEN }}
242+
210243 diffuse :
211244 runs-on : ubuntu-latest
212- if : ${{ github.event_name == 'pull_request' }}
245+ if : ${{ github.event_name == 'pull_request' && needs.diffuse_prep.outputs.base_aar_cache_hit == 'true' }}
213246 name : Diffuse checker
214- needs : build
247+ needs : [ build, diffuse_prep]
215248 steps :
216249 - uses : actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
217250 with :
0 commit comments