mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
58 lines
1.7 KiB
YAML
58 lines
1.7 KiB
YAML
name: interface check
|
|
|
|
#on: push
|
|
on: [pull_request_target]
|
|
|
|
jobs:
|
|
interface_check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- 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 }} remotes/origin/${{ github.base_ref }}
|
|
git branch
|
|
npm install --ignore-scripts
|
|
|
|
- name: build BASE declaration
|
|
working-directory: ./engine
|
|
run: |
|
|
npm run build-declaration
|
|
cp ./bin/.declarations/cc.d.ts ./bin/cc_base.d.ts
|
|
|
|
- name: rebase HEAD branch
|
|
working-directory: ./engine
|
|
run: |
|
|
git remote add HEAD_REPO https://github.com/${{ github.event.pull_request.head.repo.full_name }}.git
|
|
git pull --rebase HEAD_REPO ${{ github.head_ref }}
|
|
|
|
- name: build HEAD declaration
|
|
working-directory: ./engine
|
|
run: |
|
|
npm run build-declaration
|
|
|
|
- uses: LouisBrunner/diff-action@v0.1.2
|
|
with:
|
|
old: ./engine/bin/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
|