-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (41 loc) · 1.4 KB
/
pr_validation.yml
File metadata and controls
51 lines (41 loc) · 1.4 KB
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: PR ABI Validation
on:
pull_request_review:
types: [submitted]
jobs:
validate:
if: github.event.review.state == 'approved'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Check Review Status
uses: actions/github-script@v7
with:
script: |
const { data: reviews } = await github.rest.pulls.listReviews({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
});
const latestReviews = {};
reviews.forEach(r => {
latestReviews[r.user.login] = r.state;
});
const states = Object.values(latestReviews);
const allApproved = states.every(state => state === 'APPROVED') && states.length > 0;
if (!allApproved) {
console.log("Skipping ABI validation because not all reviewers approved.");
process.exit(0);
}
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21
cache: 'gradle'
- name: Grant execute permission
run: chmod +x ./gradlew
- name: ABI Validation
run: ./gradlew checkLegacyAbi -Pfull-build=true --no-configuration-cache