From b4e61735c7aac3f9bf0cd2f3de251d379f18031a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=9F=E6=88=98?= <40414978+PatriceJiang@users.noreply.github.com> Date: Tue, 20 Dec 2022 17:23:59 +0800 Subject: [PATCH] PR_Test download external library (#13861) --- .github/workflows/run_test_cases.yml | 39 ++++++++++++++++++++++++++++ native/cocos/core/Root.cpp | 6 ++--- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run_test_cases.yml b/.github/workflows/run_test_cases.yml index 4c6226347c..d5cf046cfb 100644 --- a/.github/workflows/run_test_cases.yml +++ b/.github/workflows/run_test_cases.yml @@ -73,6 +73,24 @@ jobs: git fetch origin pull/${{ steps.get_pr.outputs.pr_number }}/head:pull-${{ steps.get_pr.outputs.pr_number }} git merge --ff -s recursive --no-verify -m "PR Test" origin/${{ steps.parse_pr.outputs.pr_base_ref }} pull-${{ steps.get_pr.outputs.pr_number }} + - name: Download external libraries + shell: bash + run: | + set -x + EXT_VERSION=`node ./.github/workflows/get-native-external-version.js` + PRECLONE_EXTERNAL="E:/preclone/cocos-engine-external" + if [ ! -d $PRECLONE_EXTERNAL ]; then + mkdir -p $PRECLONE_EXTERNAL + git clone https://github.com/cocos/cocos-engine-external $PRECLONE_EXTERNAL + else + echo "directory $PRECLONE_EXTERNAL is ready" + fi + if [ ! -d native/external ]; then + mkdir native/external + fi + git -C $PRECLONE_EXTERNAL reset --hard + git -C $PRECLONE_EXTERNAL fetch --all --prune + git -C $PRECLONE_EXTERNAL archive --format=tar $EXT_VERSION | tar -C native/external -xf - - name: Generate bindings run: | cd ./native/tools/swig-config @@ -167,6 +185,27 @@ jobs: git branch ${{ steps.parse_pr.outputs.pr_base_ref }} git fetch origin pull/${{ steps.get_pr.outputs.pr_number }}/head:pull-${{ steps.get_pr.outputs.pr_number }} git merge --ff -s recursive --no-verify -m "PR Test" origin/${{ steps.parse_pr.outputs.pr_base_ref }} pull-${{ steps.get_pr.outputs.pr_number }} + - name: Download external libraries + shell: bash + run: | + set -x + EXT_VERSION=`node ./.github/workflows/get-native-external-version.js` + PRECLONE_EXTERNAL="/Users/admin/Documents/actions-runner/preclone/cocos-engine-external" + if [ ! -d $PRECLONE_EXTERNAL ]; then + echo "create directory $PRECLONE_EXTERNAL" + # remove all sub-folders + rm -rf /Users/admin/Documents/actions-runner/preclone + mkdir -p $PRECLONE_EXTERNAL + git clone https://github.com/cocos/cocos-engine-external $PRECLONE_EXTERNAL + else + echo "directory $PRECLONE_EXTERNAL is ready" + fi + if [ ! -d native/external ]; then + mkdir native/external + fi + git -C $PRECLONE_EXTERNAL reset --hard + git -C $PRECLONE_EXTERNAL fetch --all --prune + git -C $PRECLONE_EXTERNAL archive --format=tar $EXT_VERSION | tar -C native/external -xf - - name: Generate bindings run: | cd ./native/tools/swig-config diff --git a/native/cocos/core/Root.cpp b/native/cocos/core/Root.cpp index 917c65e1c9..6842eba28a 100644 --- a/native/cocos/core/Root.cpp +++ b/native/cocos/core/Root.cpp @@ -112,7 +112,7 @@ scene::RenderWindow *Root::createRenderWindowFromSystemWindow(ISystemWindow *win gfx::SwapchainInfo info; info.width = static_cast(size.width); info.height = static_cast(size.height); - info.windowHandle = reinterpret_cast(handle); + info.windowHandle = reinterpret_cast(handle); // NOLINT info.windowId = window->getWindowId(); gfx::Swapchain *swapchain = gfx::Device::getInstance()->createSwapchain(info); @@ -167,7 +167,7 @@ void Root::destroy() { // this.dataPoolManager.clear(); } -void Root::resize(uint32_t width, uint32_t height, uint32_t windowId) { +void Root::resize(uint32_t width, uint32_t height, uint32_t windowId) { // NOLINT for (const auto &window : _renderWindows) { auto *swapchain = window->getSwapchain(); if (swapchain && (swapchain->getWindowId() == windowId)) { @@ -435,7 +435,7 @@ void Root::frameMoveEnd() { } } -void Root::frameMove(float deltaTime, int32_t totalFrames) { +void Root::frameMove(float deltaTime, int32_t totalFrames) { // NOLINT CCObject::deferredDestroy(); _frameTime = deltaTime;