From cdfdc5d36456e7fe538a151868d2dad37ffc6612 Mon Sep 17 00:00:00 2001 From: Patrice Jiang <397136899@qq.com> Date: Fri, 6 May 2022 10:47:02 +0800 Subject: [PATCH 01/16] test ci --- .github/workflows/native-linter-android.yml | 3 ++- .../dragonbones/animation/Animation.cpp | 8 +++---- .../dragonbones/animation/TimelineState.cpp | 24 +++++++++---------- .../dragonbones/animation/WorldClock.cpp | 1 - .../dragonbones/armature/Armature.cpp | 14 ++++------- .../dragonbones/armature/DeformVertices.cpp | 6 ++--- 6 files changed, 26 insertions(+), 30 deletions(-) diff --git a/.github/workflows/native-linter-android.yml b/.github/workflows/native-linter-android.yml index 11fd6c63264..79e8a9c3a89 100644 --- a/.github/workflows/native-linter-android.yml +++ b/.github/workflows/native-linter-android.yml @@ -90,6 +90,7 @@ jobs: if: hashFiles('clang-fixes.yaml') != '' with: fixesFile: clang-fixes.yaml + useLog: true noFailOnIssue: false - repo-token: ${{ secrets.GITHUB_TOKEN }} + repo-token: ${{ secrets.PR_TOKEN }} error-limit: 200 diff --git a/native/cocos/editor-support/dragonbones/animation/Animation.cpp b/native/cocos/editor-support/dragonbones/animation/Animation.cpp index adb0451902e..fa975aad1f7 100644 --- a/native/cocos/editor-support/dragonbones/animation/Animation.cpp +++ b/native/cocos/editor-support/dragonbones/animation/Animation.cpp @@ -1,19 +1,19 @@ #include "Animation.h" -#include "../model/DisplayData.h" -#include "../model/AnimationConfig.h" -#include "../model/AnimationData.h" #include "../armature/Armature.h" #include "../armature/Bone.h" #include "../armature/Slot.h" +#include "../model/AnimationConfig.h" +#include "../model/AnimationData.h" +#include "../model/DisplayData.h" #include "AnimationState.h" + DRAGONBONES_NAMESPACE_BEGIN void Animation::_onClear() { for (const auto animationState : _animationStates) { animationState->returnToPool(); } - if (_animationConfig != nullptr) { _animationConfig->returnToPool(); } diff --git a/native/cocos/editor-support/dragonbones/animation/TimelineState.cpp b/native/cocos/editor-support/dragonbones/animation/TimelineState.cpp index db7190f1e2a..197e1919264 100644 --- a/native/cocos/editor-support/dragonbones/animation/TimelineState.cpp +++ b/native/cocos/editor-support/dragonbones/animation/TimelineState.cpp @@ -1,20 +1,21 @@ #include "TimelineState.h" -#include "WorldClock.h" -#include "Animation.h" -#include "../model/DragonBonesData.h" -#include "../model/UserData.h" -#include "../model/ArmatureData.h" -#include "../model/ConstraintData.h" -#include "../model/DisplayData.h" -#include "../model/AnimationData.h" -#include "../event/EventObject.h" -#include "../event/IEventDispatcher.h" #include "../armature/Armature.h" #include "../armature/Bone.h" -#include "../armature/Slot.h" #include "../armature/Constraint.h" #include "../armature/DeformVertices.h" +#include "../armature/Slot.h" +#include "../event/EventObject.h" +#include "../event/IEventDispatcher.h" +#include "../model/AnimationData.h" +#include "../model/ArmatureData.h" +#include "../model/ConstraintData.h" +#include "../model/DisplayData.h" +#include "../model/DragonBonesData.h" +#include "../model/UserData.h" +#include "Animation.h" #include "AnimationState.h" +#include "WorldClock.h" + DRAGONBONES_NAMESPACE_BEGIN @@ -29,7 +30,6 @@ void ActionTimelineState::_onCrossFrame(unsigned frameIndex) const { for (std::size_t i = 0; i < actionCount; ++i) { const auto actionIndex = _frameArray[frameOffset + 2 + i]; const auto action = actions[actionIndex]; - if (action->type == ActionType::Play) { const auto eventObject = BaseObject::borrowObject(); // eventObject->time = _frameArray[frameOffset] * _frameRateR; // Precision problem diff --git a/native/cocos/editor-support/dragonbones/animation/WorldClock.cpp b/native/cocos/editor-support/dragonbones/animation/WorldClock.cpp index 8bfc227c68f..d9c6139883d 100644 --- a/native/cocos/editor-support/dragonbones/animation/WorldClock.cpp +++ b/native/cocos/editor-support/dragonbones/animation/WorldClock.cpp @@ -15,7 +15,6 @@ void WorldClock::advanceTime(float passedTime) { if (passedTime < 0.0f) { passedTime = currentTime - _systemTime; } - _systemTime = currentTime; if (timeScale != 1.0f) { diff --git a/native/cocos/editor-support/dragonbones/armature/Armature.cpp b/native/cocos/editor-support/dragonbones/armature/Armature.cpp index f7f810578e6..73008fac2f1 100644 --- a/native/cocos/editor-support/dragonbones/armature/Armature.cpp +++ b/native/cocos/editor-support/dragonbones/armature/Armature.cpp @@ -1,13 +1,13 @@ #include "Armature.h" -#include "../model/TextureAtlasData.h" -#include "../model/UserData.h" -#include "../animation/WorldClock.h" #include "../animation/Animation.h" +#include "../animation/WorldClock.h" #include "../event/EventObject.h" -#include "IArmatureProxy.h" +#include "../model/TextureAtlasData.h" +#include "../model/UserData.h" #include "Bone.h" -#include "Slot.h" #include "Constraint.h" +#include "IArmatureProxy.h" +#include "Slot.h" DRAGONBONES_NAMESPACE_BEGIN @@ -240,7 +240,6 @@ void Armature::invalidUpdate(const std::string& boneName, bool updateSlot) { const auto bone = getBone(boneName); if (bone != nullptr) { bone->invalidUpdate(); - if (updateSlot) { for (const auto slot : _slots) { if (slot->getParent() == bone) { @@ -362,7 +361,6 @@ Bone* Armature::getBone(const std::string& name) const { return bone; } } - return nullptr; } @@ -378,7 +376,6 @@ Slot* Armature::getSlot(const std::string& name) const { return slot; } } - return nullptr; } @@ -390,7 +387,6 @@ Slot* Armature::getSlotByDisplay(void* display) const { } } } - return nullptr; } diff --git a/native/cocos/editor-support/dragonbones/armature/DeformVertices.cpp b/native/cocos/editor-support/dragonbones/armature/DeformVertices.cpp index ca5906a1763..5b474fd8861 100644 --- a/native/cocos/editor-support/dragonbones/armature/DeformVertices.cpp +++ b/native/cocos/editor-support/dragonbones/armature/DeformVertices.cpp @@ -1,8 +1,9 @@ #include "DeformVertices.h" -#include "../model/DragonBonesData.h" -#include "../model/DisplayData.h" #include "../armature/Armature.h" #include "../armature/Bone.h" +#include "../model/DisplayData.h" +#include "../model/DragonBonesData.h" + DRAGONBONES_NAMESPACE_BEGIN @@ -15,7 +16,6 @@ void DeformVertices::_onClear() { void DeformVertices::init(const VerticesData* verticesDataValue, Armature* armature) { verticesData = verticesDataValue; - if (verticesData != nullptr) { unsigned vertexCount = 0; if (verticesData->weight != nullptr) { From d99144afbfaa23f0da387f92fb2bbffa51b48d4e Mon Sep 17 00:00:00 2001 From: Patrice Jiang <397136899@qq.com> Date: Fri, 6 May 2022 10:54:26 +0800 Subject: [PATCH 02/16] do not ignore dragonbones --- .github/workflows/native-linter-android.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/native-linter-android.yml b/.github/workflows/native-linter-android.yml index 79e8a9c3a89..20d24127b81 100644 --- a/.github/workflows/native-linter-android.yml +++ b/.github/workflows/native-linter-android.yml @@ -49,7 +49,6 @@ jobs: - added|modified: '**/*.m' - added|modified: '**/*.mm' - added|modified: '**/*.c' - - exclude: 'native/cocos/editor-support/**' - exclude: 'native/cocos/base/etc1.*' - exclude: 'native/cocos/base/etc2.*' - exclude: 'native/cocos/bindings/manual/jsb_global.cpp' From 0a669cc26d219b036e29e74e1e6179c05482fb8b Mon Sep 17 00:00:00 2001 From: Patrice Jiang <397136899@qq.com> Date: Fri, 6 May 2022 11:13:19 +0800 Subject: [PATCH 03/16] compile on push --- .github/workflows/native-linter-android.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/native-linter-android.yml b/.github/workflows/native-linter-android.yml index 20d24127b81..9794cd439dc 100644 --- a/.github/workflows/native-linter-android.yml +++ b/.github/workflows/native-linter-android.yml @@ -1,6 +1,6 @@ name: Linter -on: pull_request +on: [pull_request, push] jobs: # Set the job key. The key is displayed as the job name @@ -85,7 +85,7 @@ jobs: clang-tidy-11 --format-style=file --export-fixes=clang-fixes.yaml $FILTERED fi - name: clang-tidy-action - uses: PatriceJiang/clang-tidy-action@master + uses: PatriceJiang/clang-tidy-action@github-api if: hashFiles('clang-fixes.yaml') != '' with: fixesFile: clang-fixes.yaml From e1413478fa31bff1310fc784c46d251dfe0ca8c0 Mon Sep 17 00:00:00 2001 From: Patrice Jiang <397136899@qq.com> Date: Fri, 6 May 2022 14:59:45 +0800 Subject: [PATCH 04/16] fix filter --- .github/workflows/native-linter-android.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/native-linter-android.yml b/.github/workflows/native-linter-android.yml index 9794cd439dc..c8c4c1eabf5 100644 --- a/.github/workflows/native-linter-android.yml +++ b/.github/workflows/native-linter-android.yml @@ -62,10 +62,9 @@ jobs: - added|modified|deleted: '**' skipedDebug: - added|modified|deleted: '**' - - exclude: 'native/cocos/editor-support/**' - name: Install CMake & Clang Tidy run: | - sudo apt install -y cmake llvm clang-tidy-11 + sudo apt install -y clang-tidy-11 ninja-build - name: Generate Compile database shell: bash @@ -82,7 +81,12 @@ jobs: if [[ "$FILTERED-xxx" == "-xxx" ]]; then echo "no source files match" else + for src in $FILTERED + do + echo "lint file ${src} ..." + done clang-tidy-11 --format-style=file --export-fixes=clang-fixes.yaml $FILTERED + du -h clang-fixes.yaml fi - name: clang-tidy-action uses: PatriceJiang/clang-tidy-action@github-api From 1f49afeaa580bf82cbcdf9b5bbf0bf6b0c4dca35 Mon Sep 17 00:00:00 2001 From: Patrice Jiang <397136899@qq.com> Date: Fri, 6 May 2022 15:16:55 +0800 Subject: [PATCH 05/16] fix push --- .github/workflows/native-linter-android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/native-linter-android.yml b/.github/workflows/native-linter-android.yml index c8c4c1eabf5..f2cdc14f1ff 100644 --- a/.github/workflows/native-linter-android.yml +++ b/.github/workflows/native-linter-android.yml @@ -1,6 +1,6 @@ name: Linter -on: [pull_request, push] +on: [pull_request] jobs: # Set the job key. The key is displayed as the job name From bd6dbb38fcc979b08acd7d427d3498936eaf1bc1 Mon Sep 17 00:00:00 2001 From: Patrice Jiang <397136899@qq.com> Date: Fri, 6 May 2022 15:18:34 +0800 Subject: [PATCH 06/16] remove other actions --- .github/workflows/mirror_gitee.yml | 17 - .github/workflows/native-bindings.yml | 59 ---- .github/workflows/native-clang-format.yml | 53 --- .github/workflows/native-compile-linux.yml | 48 --- .../workflows/native-compile-platforms.yml | 306 ------------------ .github/workflows/native-simulator.yml | 88 ----- .github/workflows/native-unit-test.yml | 42 --- .github/workflows/native_compile_self.yml | 107 ------ .github/workflows/run_test_cases.yml | 65 ---- .github/workflows/web-build.yml | 28 -- .github/workflows/web-check_version.yml | 39 --- .github/workflows/web-interface-check.yml | 74 ----- .github/workflows/web-npm_test.yml | 30 -- .github/workflows/web-quality.yml | 16 - 14 files changed, 972 deletions(-) delete mode 100644 .github/workflows/mirror_gitee.yml delete mode 100644 .github/workflows/native-bindings.yml delete mode 100644 .github/workflows/native-clang-format.yml delete mode 100644 .github/workflows/native-compile-linux.yml delete mode 100644 .github/workflows/native-compile-platforms.yml delete mode 100644 .github/workflows/native-simulator.yml delete mode 100644 .github/workflows/native-unit-test.yml delete mode 100644 .github/workflows/native_compile_self.yml delete mode 100644 .github/workflows/run_test_cases.yml delete mode 100644 .github/workflows/web-build.yml delete mode 100644 .github/workflows/web-check_version.yml delete mode 100644 .github/workflows/web-interface-check.yml delete mode 100644 .github/workflows/web-npm_test.yml delete mode 100644 .github/workflows/web-quality.yml diff --git a/.github/workflows/mirror_gitee.yml b/.github/workflows/mirror_gitee.yml deleted file mode 100644 index a2f16c42b13..00000000000 --- a/.github/workflows/mirror_gitee.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: 'GitHub Actions Mirror' - -on: [create, push, delete] - -jobs: - mirror_to_gitee: - runs-on: ubuntu-latest - steps: - - name: 'Checkout' - uses: actions/checkout@v1 - - name: 'Mirror to gitee' - uses: pixta-dev/repository-mirroring-action@v1 - with: - target_repo_url: - git@gitee.com:creator-cocos/engine.git - ssh_private_key: - ${{ secrets.GITEE_KEY }} diff --git a/.github/workflows/native-bindings.yml b/.github/workflows/native-bindings.yml deleted file mode 100644 index 2f3fdb887ff..00000000000 --- a/.github/workflows/native-bindings.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Glue - -on: - pull_request_target: - types: [closed] - -jobs: - generate-jsb: - if: github.event_name == 'pull_request_target' && github.event.action == 'closed' && github.event.pull_request.merged == true - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Download external libraries - run: | - EXT_VERSION=`node ./.github/workflows/get-native-external-version.js` - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - rm -rf native/external/.git - - - name: Run genbindings.py - run: | - python3 -m pip install PyYAML==5.4.1 Cheetah3 - python3 ./native/tools/tojs/genbindings.py - rm ./native/tools/tojs/userconf.ini - - name: Update builtin-res - run: | - cd native - npm install -g typescript - sh utils/generate_compile_commands_android.sh - cmake --build ./build --target builtin-res - - - name: Create Pull Request - uses: fish9167/create-pull-request@v3 - with: - title: '[ci skip][AUTO]: Automated PR to generate code' - body: | - Automated PR to genbindings & built resources - committer: cocos-robot - author: cocos-robot - commit-message: "[ci skip][AUTO]: Automated code generating update: ${{ github.event.pull_request.head.sha }} (#${{ github.event.number }})" - token: ${{ secrets.PR_TOKEN }} - push-to-fork: cocos-robot/engine - branch: t/bot/genbindings - branch-suffix: short-commit-hash - delete-branch: true - milestone: 1 - - #- name: Make PR - # run: | - # cd native/tools/travis-scripts && bash generate-pr.sh - # env: - # TRAVIS_OS_NAME: linux - # TRAVIS_PULL_REQUEST: "false" - # TRAVIS_BRANCH: ${{github.base_ref}} - # TRAVIS_COMMIT: ${{github.sha}} - # TRAVIS_COMMIT_MESSAGE: ${{github.event.head_commit.message}} - # GH_EMAIL: cocos-robot@cocos.com - # GH_PASSWORD: ${{ secrets.PR_TOKEN }} - # GH_TOKEN: ${{ secrets.PR_TOKEN }} - # GH_USER: cocos-robot diff --git a/.github/workflows/native-clang-format.yml b/.github/workflows/native-clang-format.yml deleted file mode 100644 index a5342fb9047..00000000000 --- a/.github/workflows/native-clang-format.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Apply clang format - -#on: [push, pull_request] -on: - pull_request_target: - types: [closed] - -jobs: - Clang-Format: - if: github.event_name == 'pull_request_target' && github.event.action == 'closed' && github.event.pull_request.merged == true - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - with: - token: ${{ github.token }} - ref: ${{ github.head_sha }} - - - id: get_change_files - uses: fish9167/file-changes-action@v1.2.3 - with: - output: ' ' - fileOutput: ' ' - - - name: Echo change files - run: | - cat $HOME/files.txt - mv $HOME/files.txt ${{github.workspace}}/files.txt - - - uses: fish9167/clang-format-lint-action@master - with: - source: ./native - exclude: ./native/cocos/bindings/auto - extensions: 'c,h,hpp,cpp,cxx' - style: file - inplace: True - clangFormatVersion: 12 - - - name: Create Pull Request - uses: fish9167/create-pull-request@v3 - with: - title: '[ci skip][AUTO]: Automated PR to fix formatting' - body: | - Automated PR to fix formatting - committer: cocos-robot - author: cocos-robot - commit-message: "[ci skip][AUTO]: Automated clang-format update: ${{ github.event.pull_request.head.sha }} (#${{ github.event.number }})" - token: ${{ secrets.PR_TOKEN }} - push-to-fork: cocos-robot/engine - branch: t/bot/fix-format - branch-suffix: short-commit-hash - delete-branch: true - milestone: 1 diff --git a/.github/workflows/native-compile-linux.yml b/.github/workflows/native-compile-linux.yml deleted file mode 100644 index d79c976216b..00000000000 --- a/.github/workflows/native-compile-linux.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Linux - -on: [pull_request] - -jobs: - compile_linux: - name: "Linux-Ubuntu" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Download external libraries - shell: bash - run: | - EXT_VERSION=`node ./.github/workflows/get-native-external-version.js` - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - - name: Generate bindings - run: | - python3 -m pip install PyYAML==5.4.1 Cheetah3 - python3 ./native/tools/tojs/genbindings.py - rm ./native/tools/tojs/userconf.ini - - name: Install dependencies - run: | - sudo apt install libx11-dev -y - sudo apt install libsndio-dev -y - sudo apt install ninja-build -y - - name: Compile - env: - COCOS_ENGINE_DEV: 1 - run: | - NATIVE_ROOT=$GITHUB_WORKSPACE/native - echo "Compiling Linux ... " - cd $GITHUB_WORKSPACE/templates/linux - mkdir -p build-linux/proj - touch build-linux/proj/cfg.cmake - echo "set(CC_USE_VULKAN OFF)" >> build-linux/proj/cfg.cmake - echo "set(CC_USE_GLES2 OFF)" >> build-linux/proj/cfg.cmake - echo "set(CC_USE_GLES3 ON)" >> build-linux/proj/cfg.cmake - echo "set(CC_USE_METAL OFF)" >> build-linux/proj/cfg.cmake - echo "set(USE_WEBSOCKET_SERVER OFF)" >> build-linux/proj/cfg.cmake - echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-linux/proj/cfg.cmake - echo "set(USE_PHYSICS_PHYSX OFF)" >> build-linux/proj/cfg.cmake - mkdir build-linux/assets - - RES_DIR=$GITHUB_WORKSPACE/templates/linux/build-linux - cd build-linux - cmake ../ -GNinja -DRES_DIR=$RES_DIR -DCOCOS_X_PATH=$NATIVE_ROOT - set +e - cmake --build . \ No newline at end of file diff --git a/.github/workflows/native-compile-platforms.yml b/.github/workflows/native-compile-platforms.yml deleted file mode 100644 index 3d06d148d63..00000000000 --- a/.github/workflows/native-compile-platforms.yml +++ /dev/null @@ -1,306 +0,0 @@ -name: Compile - -on: [pull_request] - -jobs: - compile_windows: - runs-on: windows-2019 - name: "Windows" - - steps: - - uses: actions/checkout@v2 - - name: Download external libraries - shell: bash - run: | - EXT_VERSION=`node ./.github/workflows/get-native-external-version.js` - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - - name: Install deps - run: | - choco install --forcex86 vulkan-sdk - python -m pip install PyYAML==5.4.1 Cheetah3 - - name: Generate bindings - shell: bash - run: | - python -V - cd ./native/tools/tojs - echo "Create auto-generated jsbinding glue codes." - python ./genbindings.py - rm userconf.ini - - name: Compile win64 - shell: bash - env: - COCOS_ENGINE_DEV: 1 - run: | - cd $GITHUB_WORKSPACE/templates/windows - echo "message(STATUS \"hook before \${CC_TARGET_NAME}\")" >> Pre-Sample.cmake - echo "message(STATUS \"hook after \${CC_TARGET_NAME}\")" >> Post-Sample.cmake - mkdir -p build-win64/proj - touch build-win64/proj/cfg.cmake - echo "set(CC_USE_GLES3 ON)" >> build-win64/proj/cfg.cmake - echo "set(CC_USE_VULKAN ON)" >> build-win64/proj/cfg.cmake - echo "set(CC_USE_GLES2 ON)" >> build-win64/proj/cfg.cmake - echo "set(USE_SPINE OFF)" >> build-win64/proj/cfg.cmake - echo "set(USE_DRAGONBONES OFF)" >> build-win64/proj/cfg.cmake - echo "set(USE_WEBSOCKET_SERVER ON)" >> build-win64/proj/cfg.cmake - echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-win64/proj/cfg.cmake - mkdir build-win64/assets - cd build-win64 - RES_DIR=${GITHUB_WORKSPACE//\\//}/templates/windows/build-win64 - COCOS_X_PATH=${GITHUB_WORKSPACE//\\//}/native - cmake ../ -G"Visual Studio 16 2019" -DRES_DIR=$RES_DIR -DCOCOS_X_PATH=$COCOS_X_PATH -Ax64 - cmake --build . --config Release - echo "Compile Win64 Release Done!" - - compile_android: - name: "Android" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Download external libraries - shell: bash - run: | - EXT_VERSION=`node ./.github/workflows/get-native-external-version.js` - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - - name: Generate bindings - run: | - python3 -m pip install PyYAML==5.4.1 Cheetah3 - python3 ./native/tools/tojs/genbindings.py - rm ./native/tools/tojs/userconf.ini - - name: Compile - env: - COCOS_ENGINE_DEV: 1 - run: | - NATIVE_ROOT=$GITHUB_WORKSPACE/native - ANDORID_NDK=$ANDROID_NDK_LATEST_HOME - NATIVE_DIR=$GITHUB_WORKSPACE/templates/android-template - echo "Compiling Android ... " - cd $GITHUB_WORKSPACE/templates/ - echo "message(STATUS \"hook before \${CC_TARGET_NAME}\")" >> android/template/Pre-Sample.cmake - echo "message(STATUS \"hook after \${CC_TARGET_NAME}\")" >> android/template/Post-Sample.cmake - if [ ! -d android-template ]; then - cp -r android/template android-template - fi - cd $GITHUB_WORKSPACE/templates/android/build - mkdir -p build-android/proj - touch build-android/proj/cfg.cmake - echo "set(CC_USE_GLES3 ON)" >> build-android/proj/cfg.cmake - echo "set(CC_USE_VULKAN ON)" >> build-android/proj/cfg.cmake - echo "set(CC_USE_GLES2 ON)" >> build-android/proj/cfg.cmake - echo "set(USE_WEBSOCKET_SERVER ON)" >> build-android/proj/cfg.cmake - echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-android/proj/cfg.cmake - - mkdir -p build-android/assets - - ASSET_DIR=$GITHUB_WORKSPACE/templates/android/build/build-android/ - - sed -i "s@^PROP_NDK_PATH.*@PROP_NDK_PATH=$ANDORID_NDK@g" gradle.properties - sed -i "s@^APPLICATION_ID.*@APPLICATION_ID=com.cocos.android@g" gradle.properties - sed -i "s@^RES_PATH.*@RES_PATH=$ASSET_DIR@g" gradle.properties - sed -i "s@^COCOS_ENGINE_PATH.*@COCOS_ENGINE_PATH=$NATIVE_ROOT@g" gradle.properties - sed -i "s@^NATIVE_DIR.*@NATIVE_DIR=$NATIVE_DIR@g" gradle.properties - - # To speedup CI, compile arm64-v8a only - # sed -i "s@^PROP_APP_ABI.*@PROP_APP_ABI=armeabi-v7a:arm64-v8a:x86@g" gradle.properties - sed -i "s@^PROP_APP_ABI.*@PROP_APP_ABI=arm64-v8a@g" gradle.properties - - echo "Compile Android - cmake ..." - echo "ANDORID_NDK ${ANDROID_NDK} or ${ANDROID_NDK_HOME}" - ./gradlew :CocosGame:assembleDebug --quiet - echo "Compile Android Debug Done!" - - compile_mac_x86_64: - name: "MacOS x86_64" - runs-on: macos-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - name: Download external libraries - shell: bash - run: | - EXT_VERSION=`node ./.github/workflows/get-native-external-version.js` - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - - name: Generate bindings - run: | - python -m pip install PyYAML==5.4.1 Cheetah3 - python ./native/tools/tojs/genbindings.py - rm ./native/tools/tojs/userconf.ini - - name: Compile - env: - COCOS_ENGINE_DEV: 1 - run: | - NUM_OF_CORES=`getconf _NPROCESSORS_ONLN` - NATIVE_ROOT=$GITHUB_WORKSPACE/native - echo "Compiling MacOSX ... " - cd $GITHUB_WORKSPACE/templates/mac - echo "message(STATUS \"hook before \${CC_TARGET_NAME}\")" >> Pre-Sample.cmake - echo "message(STATUS \"hook after \${CC_TARGET_NAME}\")" >> Post-Sample.cmake - mkdir -p build-mac/proj - touch build-mac/proj/cfg.cmake - echo "set(CC_USE_VULKAN OFF)" >> build-mac/proj/cfg.cmake - echo "set(CC_USE_GLES2 OFF)" >> build-mac/proj/cfg.cmake - echo "set(CC_USE_GLES3 OFF)" >> build-mac/proj/cfg.cmake - echo "set(CC_USE_METAL ON)" >> build-mac/proj/cfg.cmake - echo "set(USE_WEBSOCKET_SERVER OFF)" >> build-mac/proj/cfg.cmake - echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-mac/proj/cfg.cmake - mkdir build-mac/assets - - RES_DIR=$GITHUB_WORKSPACE/templates/mac/build-mac - cd build-mac - cmake ../ -GXcode -DCMAKE_OSX_ARCHITECTURES=x86_64 -DRES_DIR=$RES_DIR -DCOCOS_X_PATH=$NATIVE_ROOT - set +e - cmake --build . --config Release -- -quiet -jobs $NUM_OF_CORES -arch x86_64 - retcode=$? - set -e - if [ $retcode -ne 0 ]; then - echo "-----------------------------------------------------------------------------------------------" - echo "------------------------------------ recompile without `-quiet` -------------------------------" - echo "-----------------------------------------------------------------------------------------------" - cmake --build . --config Release -- -jobs $NUM_OF_CORES -arch x86_64 - fi - echo "Compile MacOSX x86_64 Release Done!" - - compile_mac_arm64: - name: "MacOS arm64" - runs-on: macos-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - name: Download external libraries - shell: bash - run: | - EXT_VERSION=`node ./.github/workflows/get-native-external-version.js` - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - - name: Generate bindings - run: | - python -m pip install PyYAML==5.4.1 Cheetah3 - python ./native/tools/tojs/genbindings.py - rm ./native/tools/tojs/userconf.ini - - name: Compile - env: - COCOS_ENGINE_DEV: 1 - run: | - NUM_OF_CORES=`getconf _NPROCESSORS_ONLN` - NATIVE_ROOT=$GITHUB_WORKSPACE/native - echo "Compiling MacOSX ... " - cd $GITHUB_WORKSPACE/templates/mac - mkdir -p build-mac/proj - touch build-mac/proj/cfg.cmake - echo "set(CC_USE_VULKAN OFF)" >> build-mac/proj/cfg.cmake - echo "set(CC_USE_GLES2 OFF)" >> build-mac/proj/cfg.cmake - echo "set(CC_USE_GLES3 OFF)" >> build-mac/proj/cfg.cmake - echo "set(CC_USE_METAL ON)" >> build-mac/proj/cfg.cmake - echo "set(USE_WEBSOCKET_SERVER OFF)" >> build-mac/proj/cfg.cmake - echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-mac/proj/cfg.cmake - mkdir build-mac/assets - - RES_DIR=$GITHUB_WORKSPACE/templates/mac/build-mac - cd build-mac - cmake ../ -GXcode -DCMAKE_OSX_ARCHITECTURES=arm64 -DRES_DIR=$RES_DIR -DCOCOS_X_PATH=$NATIVE_ROOT - set +e - cmake --build . --config Release -- -quiet -jobs $NUM_OF_CORES -arch arm64 - retcode=$? - set -e - if [ $retcode -ne 0 ]; then - echo "-----------------------------------------------------------------------------------------------" - echo "------------------------------------ recompile without `-quiet` -------------------------------" - echo "-----------------------------------------------------------------------------------------------" - cmake --build . --config Release -- -jobs $NUM_OF_CORES -arch arm64 - fi - echo "Compile MacOSX ARM64 Release Done!" - - compile_iOS: - name: "iOS" - runs-on: macos-latest - steps: - - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: latest-stable - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - name: Download external libraries - shell: bash - run: | - EXT_VERSION=`node ./.github/workflows/get-native-external-version.js` - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - - name: Generate bindings - run: | - python -m pip install PyYAML==5.4.1 Cheetah3 - python ./native/tools/tojs/genbindings.py - rm ./native/tools/tojs/userconf.ini - - name: Compile - env: - COCOS_ENGINE_DEV: 1 - run: | - set -x - NUM_OF_CORES=`getconf _NPROCESSORS_ONLN` - NATIVE_ROOT=$GITHUB_WORKSPACE/native - echo "Compiling iOS ... " - cd $GITHUB_WORKSPACE/templates/ios - echo "message(STATUS \"hook before \${CC_TARGET_NAME}\")" >> Pre-Sample.cmake - echo "message(STATUS \"hook after \${CC_TARGET_NAME}\")" >> Post-Sample.cmake - mkdir -p build-ios/proj - touch build-ios/proj/cfg.cmake - echo "set(CC_USE_GLES3 OFF)" >> build-ios/proj/cfg.cmake - echo "set(CC_USE_VULKAN OFF)" >> build-ios/proj/cfg.cmake - echo "set(CC_USE_GLES2 OFF)" >> build-ios/proj/cfg.cmake - echo "set(CC_USE_METAL ON)" >> build-ios/proj/cfg.cmake - echo "set(TARGET_IOS_VERSION 12.0)" >> build-ios/proj/cfg.cmake - echo "set(USE_WEBSOCKET_SERVER OFF)" >> build-ios/proj/cfg.cmake - echo "set(USE_DRAGONBONES OFF)" >> build-ios/proj/cfg.cmake - echo "set(CMAKE_CXX_STANDARD_REQUIRED OFF)" >> build-ios/proj/cfg.cmake - echo "set(MACOSX_BUNDLE_GUI_IDENTIFIER com.cocos.demo.ios)" >> build-ios/proj/cfg.cmake - mkdir build-ios/assets - cd build-ios - RES_DIR=$GITHUB_WORKSPACE/templates/ios/build-ios - cmake ../ -GXcode -DCMAKE_SYSTEM_NAME=iOS \ - -DCMAKE_OSX_SYSROOT=iphoneos \ - -DCMAKE_OSX_ARCHITECTURES=arm64 \ - -DRES_DIR=$RES_DIR \ - -DCOCOS_X_PATH=$NATIVE_ROOT - set +e - #cmake --build . --config Debug -- -quiet -jobs $NUM_OF_CORES -allowProvisioningUpdates CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO - cmake --build . --config Debug -- -quiet -jobs $NUM_OF_CORES CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO - retcode=$? - set -e - if [ $retcode -ne 0 ]; then - echo "-----------------------------------------------------------------------------------------------" - echo "------------------------------------ recompile without `-quiet` -------------------------------" - echo "-----------------------------------------------------------------------------------------------" - cmake --build . --config Debug -- -jobs $NUM_OF_CORES CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO - fi - echo "Compile iOS Done!" - - compile_wgpu_mac: - name: "Emscripten" - runs-on: macos-latest - if: contains( github.event.head_commit.message, 'WGPU_CI_ON' ) - steps: - - uses: actions/checkout@v2 - - name: Download external libraries - shell: bash - run: | - EXT_VERSION=`node ./.github/workflows/get-native-external-version.js` - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - - name: Setup Emscripten - run: | - git clone https://github.com/emscripten-core/emsdk.git ../emsdk - cd ../emsdk - ./emsdk install latest - ./emsdk activate latest - source ./emsdk_env.sh - emcc -v - - name: Compile - env: - COCOS_ENGINE_DEV: 1 - run: | - NATIVE_ROOT=$GITHUB_WORKSPACE/native - cd $NATIVE_ROOT/cocos/renderer/gfx-wgpu - $NATIVE_ROOT/../emsdk/upstream/emscripten/emcmake cmake . - $NATIVE_ROOT/../emsdk/upstream/emscripten/emmake make - echo "Compile WGPU by ems on MacOS Done!" diff --git a/.github/workflows/native-simulator.yml b/.github/workflows/native-simulator.yml deleted file mode 100644 index 1ef0c17cae0..00000000000 --- a/.github/workflows/native-simulator.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: Simulator - -#on: [pull_request] -on: - pull_request: - paths: - - 'native/**' - -jobs: - win_gen_simulator: - runs-on: windows-2019 - name: Windows - defaults: - run: - working-directory: ${{github.workspace}}/native - - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - - name: npm install - run: | - npm install - - name: download external libraries - run: | - node ./utils/download-deps.js - - name: install vulkan-sdk - run: | - choco install vulkan-sdk - - name: pip install - run: | - python -m pip install PyYAML==5.4.1 Cheetah3 - - name: generate bindings glue codes - shell: bash - run: | - python -V - cd ./tools/tojs - echo "Create auto-generated jsbinding glue codes." - python ./genbindings.py - rm userconf.ini - - name: gen simulator - run: | - gulp gen-simulator - - name: check result - run: | - Get-ChildItem ./simulator/Debug -Name SimulatorApp-Win32.exe - if(Test-Path ./simulator/Debug/SimulatorApp-Win32.exe) {exit 0} else {exit 1} - - # mac_gen_simulator: - # runs-on: macos-latest - # name: MacOS - # defaults: - # run: - # working-directory: ${{github.workspace}}/native - # steps: - # - uses: actions/checkout@v2 - # - uses: actions/setup-python@v2 - # with: - # python-version: "3.x" - # - name: npm install - # run: | - # npm install - # npm install gulp -g - # - name: download external libraries - # run: | - # node ./utils/download-deps.js - # - name: pip install - # run: | - # python -m pip install PyYAML Cheetah3 - # - name: generate bindings glue codes - # shell: bash - # run: | - # python -V - # cd ${{github.workspace}}/tools/travis-scripts - # echo "Create auto-generated jsbinding glue codes." - # pushd ${{github.workspace}}/tools/tojs - # python ./genbindings.py - # rm userconf.ini - # popd - # - name: gen simulator - # run: | - # gulp gen-simulator-release - # - name: check result - # run: | - # find ./ -name SimulatorApp-Mac - # [ -f ./simulator/Debug/SimulatorApp-Mac.app/Contents/MacOS/SimulatorApp-Mac ] && exit 0 || exit 1 diff --git a/.github/workflows/native-unit-test.yml b/.github/workflows/native-unit-test.yml deleted file mode 100644 index c10b87c3593..00000000000 --- a/.github/workflows/native-unit-test.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Run Tests - -on: [pull_request] - -jobs: - unit-test-with-cmake: - name: "Run on windows" - runs-on: windows-latest - defaults: - run: - working-directory: ${{github.workspace}}/native - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - - name: Downlad external libraties - run: | - npm install - npm install gulp -g - node ./utils/download-deps.js - - - name: Generate bindings - shell: bash - run: | - python -m pip install PyYAML==5.4.1 Cheetah3 - python ./tools/tojs/genbindings.py - - - name: Run Unit Tests - shell: bash - run: | - cmake -B tests/unit-test/build -S tests/unit-test - cmake --build tests/unit-test/build --config Release - ./tests/unit-test/build/src/Release/CocosTest.exe - - #### TODO(PatriceJiang): model split - # - name: Run Module Tests - # shell: bash - # run: | - # cd tests/module-tests - # bash run-test-windows.sh diff --git a/.github/workflows/native_compile_self.yml b/.github/workflows/native_compile_self.yml deleted file mode 100644 index e130b003f35..00000000000 --- a/.github/workflows/native_compile_self.yml +++ /dev/null @@ -1,107 +0,0 @@ -name: Compile-self - -on: - pull_request: - paths: - - 'native/**' - -jobs: - compile_android: - name: "Android" - runs-on: aws-linux-action - - steps: - - uses: actions/checkout@v2 - - name: Download external libraries - shell: bash - run: | - EXT_VERSION=`node ./.github/workflows/get-native-external-version.js` - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - - - name: Generate bindings - run: | - NDK_ROOT='/home/tools/android-sdk-linux/ndk-bundle' - ANDROID_NDK_HOME='/home/tools/android-sdk-linux/ndk-bundle' - export NDK_ROOT ANDROID_NDK_HOME - python3 ./native/tools/tojs/genbindings.py - rm ./native/tools/tojs/userconf.ini - - - name: Compile - env: - COCOS_ENGINE_DEV: 1 - run: | - NATIVE_ROOT=$GITHUB_WORKSPACE/native - ANDORID_NDK='/home/tools/android-sdk-linux/ndk-bundle' - ANDROID_NDK_HOME='/home/tools/android-sdk-linux/ndk-bundle' - ANDROID_SDK_ROOT='/home/tools/android-sdk-linux' - export ANDORID_NDK ANDROID_SDK_ROOT ANDROID_NDK_HOME - NATIVE_DIR=$GITHUB_WORKSPACE/templates/android-template - echo "Compiling Android ... " - cd $GITHUB_WORKSPACE/templates/ - if [ ! -d android-template ]; then - cp -r android/template android-template - fi - cd $GITHUB_WORKSPACE/templates/android/build - mkdir -p build-android/proj - touch build-android/proj/cfg.cmake - echo "set(CC_USE_GLES3 ON)" >> build-android/proj/cfg.cmake - echo "set(CC_USE_VULKAN ON)" >> build-android/proj/cfg.cmake - echo "set(CC_USE_GLES2 ON)" >> build-android/proj/cfg.cmake - echo "set(USE_WEBSOCKET_SERVER ON)" >> build-android/proj/cfg.cmake - echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-android/proj/cfg.cmake - mkdir -p build-android/assets - ASSET_DIR=$GITHUB_WORKSPACE/templates/android/build/build-android/ - sed -i "s@^PROP_NDK_PATH.*@PROP_NDK_PATH=$ANDORID_NDK@g" gradle.properties - sed -i "s@^APPLICATION_ID.*@APPLICATION_ID=com.cocos.android@g" gradle.properties - sed -i "s@^RES_PATH.*@RES_PATH=$ASSET_DIR@g" gradle.properties - sed -i "s@^COCOS_ENGINE_PATH.*@COCOS_ENGINE_PATH=$NATIVE_ROOT@g" gradle.properties - sed -i "s@^NATIVE_DIR.*@NATIVE_DIR=$NATIVE_DIR@g" gradle.properties - # To speedup CI, compile arm64-v8a only - # sed -i "s@^PROP_APP_ABI.*@PROP_APP_ABI=armeabi-v7a:arm64-v8a:x86@g" gradle.properties - sed -i "s@^PROP_APP_ABI.*@PROP_APP_ABI=arm64-v8a@g" gradle.properties - echo "Compile Android - cmake ..." - echo "ANDORID_NDK ${ANDROID_NDK} or ${ANDROID_NDK_HOME}" - ./gradlew :CocosGame:assembleDebug --quiet - echo "Compile Android Debug Done!" - - compile_windows: - name: "Windows" - runs-on: aws-win-action - - steps: - - uses: actions/checkout@v2 - - name: Download external libraries - shell: bash - run: | - EXT_VERSION=`node ./.github/workflows/get-native-external-version.js` - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - - - name: Generate bindings - shell: bash - run: | - python2 -V - cd ./native/tools/tojs - echo "Create auto-generated jsbinding glue codes." - python2 ./genbindings.py - rm userconf.ini - - - name: Compile win64 - shell: bash - env: - COCOS_ENGINE_DEV: 1 - run: | - cd $GITHUB_WORKSPACE/templates/windows - mkdir -p build-win64/proj - touch build-win64/proj/cfg.cmake - echo "set(CC_USE_GLES3 ON)" >> build-win64/proj/cfg.cmake - echo "set(CC_USE_VULKAN ON)" >> build-win64/proj/cfg.cmake - echo "set(CC_USE_GLES2 ON)" >> build-win64/proj/cfg.cmake - echo "set(USE_WEBSOCKET_SERVER ON)" >> build-win64/proj/cfg.cmake - echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-win64/proj/cfg.cmake - mkdir build-win64/assets - cd build-win64 - RES_DIR=${GITHUB_WORKSPACE//\\//}/templates/windows/build-win64 - COCOS_X_PATH=${GITHUB_WORKSPACE//\\//}/native - cmake ../ -G"Visual Studio 15 2017" -DRES_DIR=$RES_DIR -DCOCOS_X_PATH=$COCOS_X_PATH -Ax64 - cmake --build . --config Release - echo "Compile Win64 Release Done!" diff --git a/.github/workflows/run_test_cases.yml b/.github/workflows/run_test_cases.yml deleted file mode 100644 index 55aa672a5a7..00000000000 --- a/.github/workflows/run_test_cases.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: run test cases - -on: - issue_comment: - types: [created, edited] - pull_request_review_comment: - types: [created, edited] - -jobs: - run-test-cases: - if: | - github.event.issue.pull_request && contains(github.event.comment.body, '@cocos-robot run test cases') - runs-on: run-test-win01 - - steps: - - uses: octokit/request-action@v2.x - id: find_pull_request - with: - route: GET /repos/cocos-creator/engine/pulls/${{ github.event.issue.number }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Parse Pull Request - id: parse_pull_request - shell: pwsh - run: | - $pull_request = @" - ${{ steps.find_pull_request.outputs.data }} - "@ | ConvertFrom-Json - Write-Host $pull_request - Write-Host "::set-output name=pr_html_url::$($pull_request.html_url)" - Write-Host "::set-output name=pr_number::$($pull_request.number)" - Write-Host "::set-output name=pr_author::$($pull_request.user.login)" - Write-Host "::set-output name=pr_head_ref::$($pull_request.head.ref)" - Write-Host "::set-output name=pr_head_sha::$($pull_request.head.sha)" - Write-Host "::set-output name=pr_base_ref::$($pull_request.base.ref)" - Write-Host "::set-output name=pr_base_sha::$($pull_request.base.sha)" - - name: Echo pull request - run: | - echo "${{ steps.parse_pull_request.outputs.pr_head_ref }}" - echo "${{ steps.parse_pull_request.outputs.pr_head_sha }}" - echo "${{ steps.parse_pull_request.outputs.pr_base_ref }}" - echo "${{ steps.parse_pull_request.outputs.pr_base_sha }}" - - - name: update comment - uses: peter-evans/create-or-update-comment@v1 - with: - issue-number: ${{ steps.parse_pull_request.outputs.pr_number }} - body: | - @${{ steps.parse_pull_request.outputs.pr_author }},请查阅任务(run test cases)执行结果:https://github.com/cocos-creator/engine/actions/runs/${{ github.run_id }} - - name: 'Checkout engine' - uses: actions/checkout@v2 - with: - ref: ${{ steps.parse_pull_request.outputs.pr_head_sha }} - path: engine - - - name: 'npm install' - run: | - cd engine - npm -v - npm install --registry https://registry.npm.taobao.org - - - name: 'Call run test cases job' - run: | - python3 -u ./pr-test/main.py ${{ steps.parse_pull_request.outputs.pr_base_ref }} diff --git a/.github/workflows/web-build.yml b/.github/workflows/web-build.yml deleted file mode 100644 index f98fbe3914f..00000000000 --- a/.github/workflows/web-build.yml +++ /dev/null @@ -1,28 +0,0 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - -name: build - -on: [pull_request] - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [12.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: npm install -g gulp - - run: npm ci - - run: echo "::add-matcher::.github/workflows/build-problem-matcher.json" - - run: gulp build-h5-source - #- run: echo "::remove-matcher owner=circular-reference-check::" diff --git a/.github/workflows/web-check_version.yml b/.github/workflows/web-check_version.yml deleted file mode 100644 index 63dad91928f..00000000000 --- a/.github/workflows/web-check_version.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Check version - -#on: push -on: [create, pull_request] - -jobs: - Check_pull_request_version: - runs-on: ubuntu-latest - if: github.event_name == 'pull_request' - steps: - - uses: actions/checkout@v2 - - - name: npm install - run: | - node -v - npm install || exit 0 - - - name: check version - run: | - branch=`echo ${{ github.base_ref }} | awk -F'/' '{print $NF}'` - echo "Branch: ${branch}" - npm run varify-engine-version -- ${branch} - - Check_create_version: - runs-on: ubuntu-latest - if: github.event_name == 'create' - steps: - - uses: actions/checkout@v2 - - - name: npm install - run: | - node -v - npm install || exit 0 - - name: check version - run: | - branch=`echo ${{ github.ref }} | awk -F'/' '{print $NF}'` - echo "Branch: ${branch}" - npm run varify-engine-version -- ${branch} - diff --git a/.github/workflows/web-interface-check.yml b/.github/workflows/web-interface-check.yml deleted file mode 100644 index 99f25eab628..00000000000 --- a/.github/workflows/web-interface-check.yml +++ /dev/null @@ -1,74 +0,0 @@ -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 }}_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 - 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 diff --git a/.github/workflows/web-npm_test.yml b/.github/workflows/web-npm_test.yml deleted file mode 100644 index c438f46dc54..00000000000 --- a/.github/workflows/web-npm_test.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: npm test - -on: [push, pull_request] - -jobs: - npm_test: - runs-on: ubuntu-18.04 - - steps: - - uses: actions/checkout@v2 - - - uses: actions/setup-node@v2 - with: - node-version: '12.13' - - - name: install gulp - run: | - npm install -g gulp - - - name: npm install - run: | - npm install - - - name: build-debug-infos - run: | - gulp build-debug-infos - - - name: run test - run: | - npm test diff --git a/.github/workflows/web-quality.yml b/.github/workflows/web-quality.yml deleted file mode 100644 index 7a6ee86f55a..00000000000 --- a/.github/workflows/web-quality.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Quality -on: [push, pull_request] -jobs: - eslint: - name: Run ESLint - if: github.actor!= 'dependabot' # ignore the pull request which comes from user dependabot. See https://github.community/t/how-to-stop-github-actions-workflow-to-trigger-when-the-pull-request-is-from-dependabot-preview/116486/3 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: 12 - - run: npm ci - - name: Run ESLint - shell: pwsh - run: ./.github/workflows/eslint.ps1 From 5b2db5111c3c9338c14275ec8f58ab60dc73b1e9 Mon Sep 17 00:00:00 2001 From: Patrice Jiang <397136899@qq.com> Date: Fri, 6 May 2022 15:28:03 +0800 Subject: [PATCH 07/16] enable rest api --- .github/workflows/automation_labels.yml | 36 --------------------- .github/workflows/native-linter-android.yml | 2 +- 2 files changed, 1 insertion(+), 37 deletions(-) delete mode 100644 .github/workflows/automation_labels.yml diff --git a/.github/workflows/automation_labels.yml b/.github/workflows/automation_labels.yml deleted file mode 100644 index fe3642ff068..00000000000 --- a/.github/workflows/automation_labels.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: automation-labels - -on: - pull_request_target: - types: [opened] - -jobs: - automate-labels: - concurrency: - group: ${{ github.head_ref }} - cancel-in-progress: true - runs-on: ubuntu-latest - steps: - - name: Check organization - id: get_check_code - run: | - http_code=`curl -s --head -I -H "Authorization: token ${{ secrets.LABEl_TOKEN }}" -H "Accept: application/vnd.github.v3+json" https://api.github.com/orgs/cocos/members/${{ github.event.pull_request.user.login }} | awk '/HTTP/{print $2}'` - echo "::set-output name=http_code::${http_code}" - - name: Echo username organization - run: | - echo ${{ github.event.pull_request.user.login }} - echo ${{ steps.get_check_code.outputs.http_code }} - - name: Add contribution label - if: | - steps.get_check_code.outputs.http_code == 404 - uses: OperationsYU/labeler@master - with: - add-labels: "contribution" - - - name: assignment - if: | - steps.get_check_code.outputs.http_code == 404 - uses: OperationsYU/auto-assignment@v1 - with: - token: ${{ secrets.LABEl_TOKEN }} - users: '["holycanvas"]' diff --git a/.github/workflows/native-linter-android.yml b/.github/workflows/native-linter-android.yml index f2cdc14f1ff..71eecea208f 100644 --- a/.github/workflows/native-linter-android.yml +++ b/.github/workflows/native-linter-android.yml @@ -93,7 +93,7 @@ jobs: if: hashFiles('clang-fixes.yaml') != '' with: fixesFile: clang-fixes.yaml - useLog: true + useLog: false noFailOnIssue: false repo-token: ${{ secrets.PR_TOKEN }} error-limit: 200 From deac53938198f0d7b37946e97f9e057f17f4f7ed Mon Sep 17 00:00:00 2001 From: Patrice Jiang <397136899@qq.com> Date: Fri, 6 May 2022 16:21:41 +0800 Subject: [PATCH 08/16] add token --- .github/workflows/native-linter-android.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/native-linter-android.yml b/.github/workflows/native-linter-android.yml index 71eecea208f..8208914e5c5 100644 --- a/.github/workflows/native-linter-android.yml +++ b/.github/workflows/native-linter-android.yml @@ -96,4 +96,5 @@ jobs: useLog: false noFailOnIssue: false repo-token: ${{ secrets.PR_TOKEN }} + github-token: ${{ secrets.GITHUB_TOKEN}} error-limit: 200 From 644a94917ecfd1c9e66d04e3f66304901f5ed3f2 Mon Sep 17 00:00:00 2001 From: Patrice Jiang <397136899@qq.com> Date: Fri, 6 May 2022 17:01:06 +0800 Subject: [PATCH 09/16] add token --- .github/workflows/native-linter-android.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/native-linter-android.yml b/.github/workflows/native-linter-android.yml index 8208914e5c5..a6ed718476a 100644 --- a/.github/workflows/native-linter-android.yml +++ b/.github/workflows/native-linter-android.yml @@ -1,7 +1,9 @@ name: Linter -on: [pull_request] - +# on: [pull_request] +on: + pull_request_target: + types: [closed] jobs: # Set the job key. The key is displayed as the job name # when a job name is not provided @@ -96,5 +98,5 @@ jobs: useLog: false noFailOnIssue: false repo-token: ${{ secrets.PR_TOKEN }} - github-token: ${{ secrets.GITHUB_TOKEN}} + github-token: ${{ secrets.GITHUB_TOKEN }} error-limit: 200 From 8026fc0a9fa7af594c837f82d5ba3b65e084c47e Mon Sep 17 00:00:00 2001 From: Patrice Jiang <397136899@qq.com> Date: Fri, 6 May 2022 17:02:09 +0800 Subject: [PATCH 10/16] add token --- .github/workflows/native-linter-android.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/native-linter-android.yml b/.github/workflows/native-linter-android.yml index a6ed718476a..ae0b1e2d484 100644 --- a/.github/workflows/native-linter-android.yml +++ b/.github/workflows/native-linter-android.yml @@ -2,8 +2,8 @@ name: Linter # on: [pull_request] on: - pull_request_target: - types: [closed] + pull_request_target + jobs: # Set the job key. The key is displayed as the job name # when a job name is not provided From 60d442deb275cc11ac4e7b998e3e8f2e85961128 Mon Sep 17 00:00:00 2001 From: Patrice Jiang <397136899@qq.com> Date: Fri, 6 May 2022 17:04:32 +0800 Subject: [PATCH 11/16] add token 2 --- .github/workflows/native-linter-android.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/native-linter-android.yml b/.github/workflows/native-linter-android.yml index ae0b1e2d484..c600658e1ce 100644 --- a/.github/workflows/native-linter-android.yml +++ b/.github/workflows/native-linter-android.yml @@ -1,9 +1,9 @@ name: Linter -# on: [pull_request] -on: - pull_request_target - +on: [pull_request] +# on: + # pull_request_target + jobs: # Set the job key. The key is displayed as the job name # when a job name is not provided From 4ce93b8dea979b8462d7f072a1926e3403069417 Mon Sep 17 00:00:00 2001 From: Patrice Jiang <397136899@qq.com> Date: Sat, 7 May 2022 09:59:08 +0800 Subject: [PATCH 12/16] save --- .github/workflows/native-linter-android.yml | 65 +++++++++++++-------- 1 file changed, 40 insertions(+), 25 deletions(-) diff --git a/.github/workflows/native-linter-android.yml b/.github/workflows/native-linter-android.yml index c600658e1ce..b4db37de456 100644 --- a/.github/workflows/native-linter-android.yml +++ b/.github/workflows/native-linter-android.yml @@ -74,29 +74,44 @@ jobs: cd native ./utils/generate_compile_commands_android.sh - - name: Generate clang-fix.yaml - shell: bash - if: ${{ steps.listchanged.outputs.source == 'true' }} - run: | - CPP="${{ steps.listchanged.outputs.source_files }}" - FILTERED=`node .github/workflows/filter_by_cdb.js $CPP` - if [[ "$FILTERED-xxx" == "-xxx" ]]; then - echo "no source files match" - else - for src in $FILTERED - do - echo "lint file ${src} ..." - done - clang-tidy-11 --format-style=file --export-fixes=clang-fixes.yaml $FILTERED - du -h clang-fixes.yaml - fi - - name: clang-tidy-action - uses: PatriceJiang/clang-tidy-action@github-api - if: hashFiles('clang-fixes.yaml') != '' + - uses: shenxianpeng/cpp-linter-action@v1 + name: lint action + id: linter + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - fixesFile: clang-fixes.yaml - useLog: false - noFailOnIssue: false - repo-token: ${{ secrets.PR_TOKEN }} - github-token: ${{ secrets.GITHUB_TOKEN }} - error-limit: 200 + style: file + database: native/build/ + + - name: Fail fast! + if: steps.linter.outputs.checks-failed > 0 + run: | + echo "Some files failed the linting checks!" + # for actual deployment + # run: exit 1 + # - name: Generate clang-fix.yaml + # shell: bash + # if: ${{ steps.listchanged.outputs.source == 'true' }} + # run: | + # CPP="${{ steps.listchanged.outputs.source_files }}" + # FILTERED=`node .github/workflows/filter_by_cdb.js $CPP` + # if [[ "$FILTERED-xxx" == "-xxx" ]]; then + # echo "no source files match" + # else + # for src in $FILTERED + # do + # echo "lint file ${src} ..." + # done + # clang-tidy-11 --format-style=file --export-fixes=clang-fixes.yaml $FILTERED + # du -h clang-fixes.yaml + # fi + # - name: clang-tidy-action + # uses: PatriceJiang/clang-tidy-action@github-api + # if: hashFiles('clang-fixes.yaml') != '' + # with: + # fixesFile: clang-fixes.yaml + # useLog: false + # noFailOnIssue: false + # repo-token: ${{ secrets.PR_TOKEN }} + # github-token: ${{ secrets.GITHUB_TOKEN }} + # error-limit: 200 From b1bcf19e9fbb5fc229dd18660d2d4c23ba6fda2a Mon Sep 17 00:00:00 2001 From: Patrice Jiang <397136899@qq.com> Date: Sat, 7 May 2022 10:27:26 +0800 Subject: [PATCH 13/16] save --- .github/workflows/native-linter-android.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/native-linter-android.yml b/.github/workflows/native-linter-android.yml index b4db37de456..9b1810a6530 100644 --- a/.github/workflows/native-linter-android.yml +++ b/.github/workflows/native-linter-android.yml @@ -81,12 +81,15 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: style: file + version: 11 database: native/build/ + thread-comments: true - name: Fail fast! if: steps.linter.outputs.checks-failed > 0 run: | echo "Some files failed the linting checks!" + exit 1 # for actual deployment # run: exit 1 # - name: Generate clang-fix.yaml From 4721eae9b954b5e2e6e4a12879ae2a921b269b0c Mon Sep 17 00:00:00 2001 From: Patrice Jiang <397136899@qq.com> Date: Sat, 7 May 2022 10:47:52 +0800 Subject: [PATCH 14/16] repo root --- .github/workflows/native-linter-android.yml | 33 ++------------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/.github/workflows/native-linter-android.yml b/.github/workflows/native-linter-android.yml index 9b1810a6530..4fe1644cedc 100644 --- a/.github/workflows/native-linter-android.yml +++ b/.github/workflows/native-linter-android.yml @@ -38,35 +38,6 @@ jobs: cd ./native/tools/tojs python ./genbindings.py rm userconf.ini - - name: Get changed files - uses: PatriceJiang/paths-filter@master - id: listchanged - with: - list-files: shell - filters: | - source: - - added|modified: '**/*.cpp' - - added|modified: '**/*.h' - - added|modified: '**/*.hpp' - - added|modified: '**/*.m' - - added|modified: '**/*.mm' - - added|modified: '**/*.c' - - exclude: 'native/cocos/base/etc1.*' - - exclude: 'native/cocos/base/etc2.*' - - exclude: 'native/cocos/bindings/manual/jsb_global.cpp' - - exclude: 'native/cocos/bindings/manual/jsb_dragonbones_manual.cpp' - - exclude: 'native/cocos/bindings/manual/jsb_spine_manual.cpp' - - exclude: 'native/cocos/bindings/manual/jsb_socketio.cpp' - - exclude: 'native/cocos/bindings/manual/jsb_conversions.*' - - exclude: 'native/cocos/bindings/jswrapper/v8/debugger/**' - - exclude: 'native/cocos/audio/android/audio_utils/**' - allChanges: - - added|modified|deleted: '**' - skipedDebug: - - added|modified|deleted: '**' - - name: Install CMake & Clang Tidy - run: | - sudo apt install -y clang-tidy-11 ninja-build - name: Generate Compile database shell: bash @@ -82,8 +53,8 @@ jobs: with: style: file version: 11 - database: native/build/ - thread-comments: true + thread-comments: false + repo-root: native - name: Fail fast! if: steps.linter.outputs.checks-failed > 0 From d66356901e332fcd792f22ad647c02b48291c13f Mon Sep 17 00:00:00 2001 From: Patrice Jiang <397136899@qq.com> Date: Sat, 7 May 2022 10:56:28 +0800 Subject: [PATCH 15/16] repo root --- .github/workflows/native-linter-android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/native-linter-android.yml b/.github/workflows/native-linter-android.yml index 4fe1644cedc..a29dec3cd16 100644 --- a/.github/workflows/native-linter-android.yml +++ b/.github/workflows/native-linter-android.yml @@ -54,7 +54,7 @@ jobs: style: file version: 11 thread-comments: false - repo-root: native + database: native - name: Fail fast! if: steps.linter.outputs.checks-failed > 0 From 23a28264f9b9c227f2fa7d3a3e6c886b52b0e608 Mon Sep 17 00:00:00 2001 From: Patrice Jiang <397136899@qq.com> Date: Sat, 7 May 2022 11:16:24 +0800 Subject: [PATCH 16/16] repo root --- .github/workflows/native-linter-android.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/native-linter-android.yml b/.github/workflows/native-linter-android.yml index a29dec3cd16..3ab3a3b01d5 100644 --- a/.github/workflows/native-linter-android.yml +++ b/.github/workflows/native-linter-android.yml @@ -54,6 +54,7 @@ jobs: style: file version: 11 thread-comments: false + ignore: native/cocos/editor-support|native/cocos/bindings/manual|native/cocos/bindings/jswrapper/v8/debugger|native/cocos/audio/android/audio_utils|native/cocos/renderer/gfx-vulkan/volk|native/cocos/bindings/auto database: native - name: Fail fast!