Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3.8.1 merge v3.8.0 #15757

Merged
merged 15 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 35 additions & 11 deletions .github/workflows/run_test_cases.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: run test cases

on:
pull_request_target:
pull_request:
issue_comment:
types: [created, edited]

permissions: read-all

# github.head_ref is only defined on pull_request events
concurrency:
group: ${{ github.workflow }}-${{ github.actor }}-${{ github.head_ref || github.run_id }}
Expand Down Expand Up @@ -279,16 +281,38 @@ jobs:
JOBID=`cat /usr/local/lib/node_modules/@cctest/scheduler/logs/PR-TEST/nowJobId.log`
cd ..
python3 -u ./python/main.py --target=job_editor --jobid=$JOBID
- name: Update Comment
uses: peter-evans/create-or-update-comment@v1
- name: Write comment body and issue number to file
uses: actions/github-script@v5
env:
PR_AUTHOR: ${{ steps.parse_pr.outputs.pr_author }}
EDITOR_VERSION: ${{ steps.run_test_cases.outputs.editor }}
TASK_STATUS: ${{ steps.run_test_cases.outputs.status }}
TASK_REPORT: ${{ steps.run_test_cases.outputs.report }}
JOB_ID: ${{ steps.run_test_cases.outputs.jobid }}
GITHUB_RUN_ID: ${{ github.run_id }}
PR_NUMBER: ${{ steps.get_pr.outputs.pr_number }}
with:
issue-number: ${{ steps.get_pr.outputs.pr_number }}
body: |
@${{ steps.parse_pr.outputs.pr_author }}, Please check the result of `run test cases`:
script: |
const fs = require('fs');
fs.writeFileSync('pr.txt', process.env.PR_NUMBER);
fs.writeFileSync('comment.txt', `@${process.env.PR_AUTHOR}, Please check the result of \`run test cases\`:
- Test Platform: PR-Test
- Editor Version: ${{ steps.run_test_cases.outputs.editor }}
- Task Result: ${{ steps.run_test_cases.outputs.status }}
- Task URL: http://cctest.cocos.org/#/reportview/PR-TEST/${{ steps.run_test_cases.outputs.jobid }}/-1
- GitHub Action: https://github.com/cocos/cocos-engine/actions/runs/${{ github.run_id }}
- Editor Version: ${process.env.EDITOR_VERSION}
- Task Result: ${process.env.TASK_STATUS}
- Task URL: http://cctest.cocos.org/#/reportview/PR-TEST/${process.env.JOB_ID}/-1
- GitHub Action: https://github.com/cocos/cocos-engine/actions/runs/${process.env.GITHUB_RUN_ID}
## Task Details
${{ steps.run_test_cases.outputs.report }}
${process.env.TASK_REPORT}`);
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: pr.txt
path: |
pr.txt
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: comment.txt
path: |
comment.txt

36 changes: 36 additions & 0 deletions .github/workflows/run_test_cases_pr_comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: run test cases PR comment
on:
workflow_run:
workflows: ["run test cases"]
types:
- completed

permissions:
issues: write
pull-requests: write

jobs:
post-pr-comment:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- name: Download artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUN_ID: ${{ github.event.workflow_run.id }}
run: |
gh run download -R "${{ github.repository }}" --name "pr.txt" "$RUN_ID"
gh run download -R "${{ github.repository }}" --name "comment.txt" "$RUN_ID"
- name: Set PR environment variable
uses: actions/github-script@v4
with:
script: |
const fs = require('fs');
const pr = fs.readFileSync('pr.txt', 'utf8').trim();
core.exportVariable('PR_NUMBER', pr);

- name: Update Comment
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ env.PR_NUMBER }}
body-path: 'comment.txt'
27 changes: 27 additions & 0 deletions .github/workflows/web-interface-check-pr-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: <Web> Interface check PR comment
on:
workflow_run:
workflows: ["<Web> Interface check"]
types:
- completed

permissions:
issues: write
pull-requests: write

jobs:
post-pr-comment:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- name: Download artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUN_ID: ${{ github.event.workflow_run.id }}
run: |
gh run download -R "${{ github.repository }}" --name "interface-diff.txt" "$RUN_ID"
- name: Post interface-diff.txt as comment
uses: marocchino/sticky-pull-request-comment@v2
with:
path: interface-diff.txt
number: ${{ github.event.workflow_run.pull_requests[0].number }}
9 changes: 7 additions & 2 deletions .github/workflows/web-interface-check.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
name: <Web> Interface check

#on: push
on: [pull_request_target]
on: [pull_request]

# 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

permissions: read-all

jobs:
interface_check:
if:
Expand Down Expand Up @@ -79,6 +81,9 @@ jobs:
cat ./interface-diff.txt
node ./.github/workflows/interface-check-report.js

- uses: marocchino/sticky-pull-request-comment@v2
- name: Upload interface-diff.txt artifact
uses: actions/upload-artifact@v2
with:
name: interface-diff.txt
path: ./engine/interface-diff.txt

4 changes: 4 additions & 0 deletions EngineErrorMap.md
Original file line number Diff line number Diff line change
Expand Up @@ -2911,6 +2911,10 @@ Spine: Animation not found: %s

Spine: Animation not found: %s

### 7511

Spine: Invalid input!

### 7600

The context of RenderTexture is invalid.
Expand Down
30 changes: 29 additions & 1 deletion cocos/spine/lib/spine-define.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,22 @@ function overrideDefineArrayProp (prototype, getPropVector, name): void {
});
}

function overrideDefineArrayFunction (prototype, getPropVector, name): void {
Object.defineProperty(prototype, name, {
value () {
const array: any[] = [];
const vectors = getPropVector.call(this);
const count = vectors.size();
for (let i = 0; i < count; i++) {
const objPtr = vectors.get(i);
array.push(objPtr);
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return array;
},
});
}

function overrideClass (wasm): void {
spine.wasmUtil = wasm.SpineWasmUtil;
spine.wasmUtil.wasm = wasm;
Expand Down Expand Up @@ -192,7 +208,7 @@ function overrideProperty_BoneData (): void {
});
}

function overrideProperty_Attachment () {
function overrideProperty_Attachment (): void {
const prototype = spine.Attachment.prototype as any;
const propertyPolyfills = [
{
Expand Down Expand Up @@ -1127,6 +1143,18 @@ function overrideProperty_Skin (): void {
overrideDefineArrayProp(prototype, prototype.getBones, 'bones');
overrideDefineArrayProp(prototype, prototype.getAttachments, 'attachments');
overrideDefineArrayProp(prototype, prototype.getConstraints, 'constraints');
overrideDefineArrayFunction(prototype, prototype.getAttachments, 'getAttachments');
const originGetAttachmentsForSlot = prototype.getAttachmentsForSlot;
Object.defineProperty(prototype, 'getAttachmentsForSlot', {
value (slotIndex: number, attachments: Array<spine.SkinEntry>) {
const vectors = originGetAttachmentsForSlot.call(this, slotIndex);
const count = vectors.size();
for (let i = 0; i < count; i++) {
const objPtr = vectors.get(i);
attachments.push(objPtr);
}
},
});
}

function overrideProperty_SkinEntry (): void {
Expand Down
Loading