-
Notifications
You must be signed in to change notification settings - Fork 2k
84 lines (73 loc) · 2.61 KB
/
web-interface-check.yml
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: <Web> Interface check
#on: push
on: [pull_request_target]
# github.head_ref is only defined on pull_request events
concurrency:
group: ${{ github.workflow }}-${{ github.actor }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
interface_check:
if:
(! contains(github.event.pull_request.body, '[X] does not change any runtime related code or build configuration'))
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v2
with:
node-version: '14.19'
- uses: actions/checkout@v3
name: Checkout Base Ref
with:
repository: ${{ github.event.pull_request.base.repo.full_name }}
ref: ${{ github.base_ref }}
path: './engine'
- run: |
"EXT_VERSION=$(node ./engine/.github/workflows/get-native-external-version.js)" >> $env:GITHUB_ENV
shell: pwsh
- uses: actions/checkout@v3
name: Download external
with:
repository: cocos/cocos-engine-external
path: './engine/native/external'
ref: "${{ env.EXT_VERSION }}"
fetch-depth: 1
- name: Build Base Declarations
working-directory: ./engine
run: |
npm install
- name: Clear npm Cache
run: |
npm cache clean --force
- uses: actions/checkout@v3
name: Checkout Head Ref
with:
ref: 'refs/pull/${{ github.event.pull_request.number }}/merge' # Don't check out the head commit, checkout the "merge commit" instead
path: './engine-HEAD'
- run: |
"EXT_VERSION_HEAD=$(node ./engine-HEAD/.github/workflows/get-native-external-version.js)" >> $env:GITHUB_ENV
shell: pwsh
- uses: actions/checkout@v3
name: Download external
with:
repository: cocos/cocos-engine-external
path: './engine-HEAD/native/external'
ref: "${{ env.EXT_VERSION_HEAD }}"
fetch-depth: 1
- name: Build Head Declarations
working-directory: ./engine-HEAD
run: |
npm install
- uses: LouisBrunner/[email protected]
with:
old: ./engine/bin/.declarations/cc.d.ts
new: ./engine-HEAD/bin/.declarations/cc.d.ts
mode: addition
tolerance: worse
output: ./engine/interface-diff.txt
- name: optimize interface check report
working-directory: ./engine
run: |
cat ./interface-diff.txt
node ./.github/workflows/interface-check-report.js
- uses: marocchino/sticky-pull-request-comment@v2
with:
path: ./engine/interface-diff.txt