-
Notifications
You must be signed in to change notification settings - Fork 2.1k
86 lines (72 loc) · 2.54 KB
/
web-interface-check.yml
File metadata and controls
86 lines (72 loc) · 2.54 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
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
85
86
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'
- name: clone REPO
run: |
git config --global user.name "test"
git config --global user.email "test@test.com"
git clone https://github.com/cocos-creator/engine.git
- name: checkout BASE branch
working-directory: ./engine
run: |
git fetch origin ${{ github.base_ref }}
git checkout -b ${{ github.base_ref }}_BASE remotes/origin/${{ github.base_ref }}
git branch
- name: npm install BASE branch
working-directory: ./engine
run: |
npm install --ignore-scripts
- name: build BASE declaration
working-directory: ./engine
run: |
npm run build-declaration
cp ./bin/.declarations/cc.d.ts ../cc_base.d.ts
- name: clear dependencies
working-directory: ./engine
run: |
git checkout .
git clean -xfd
npm cache clean --force
ls -la
- name: merge HEAD branch
working-directory: ./engine
run: |
git remote add HEAD_REPO https://github.com/${{ github.event.pull_request.head.repo.full_name }}.git
git fetch HEAD_REPO ${{ github.head_ref }}
git merge remotes/HEAD_REPO/${{ github.head_ref }}
- name: npm install HEAD branch
working-directory: ./engine
run: |
npm install --ignore-scripts
- name: build HEAD declaration
working-directory: ./engine
run: |
npm run build-declaration
- uses: LouisBrunner/diff-action@v0.1.2
with:
old: ./cc_base.d.ts
new: ./engine/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