解决ANRTest的卡死问题 #2187
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: unity unittest | |
| on: | |
| workflow_dispatch: | |
| push: | |
| paths: | |
| - unity/Assets/** | |
| - unity/test/** | |
| - unity/native_src/** | |
| - unity/cli/** | |
| - unreal/Puerts/Source/JsEnv/Private/V8InspectorImpl.cpp | |
| - unreal/Puerts/Source/JsEnv/Private/V8InspectorImpl.h | |
| - unreal/Puerts/Source/JsEnv/Private/WebSocketImpl.cpp | |
| - unreal/Puerts/Source/JsEnv/Private/PromiseRejectCallback.hpp | |
| - .github/workflows/unity_unittest.yml | |
| - .github/workflows/run_android_test.sh | |
| - .github/workflows/composites/** | |
| pull_request: | |
| paths: | |
| - unity/Assets/** | |
| - unity/test/** | |
| - unity/native_src/** | |
| - unity/cli/** | |
| - unreal/Puerts/Source/JsEnv/Private/V8InspectorImpl.cpp | |
| - unreal/Puerts/Source/JsEnv/Private/V8InspectorImpl.h | |
| - unreal/Puerts/Source/JsEnv/Private/WebSocketImpl.cpp | |
| - unreal/Puerts/Source/JsEnv/Private/PromiseRejectCallback.hpp | |
| - .github/workflows/unity_unittest.yml | |
| - .github/workflows/run_android_test.sh | |
| - .github/workflows/composites/** | |
| # branches-ignore: | |
| # - 'unity-3.0.0' | |
| concurrency: | |
| group: unity-ci-global | |
| cancel-in-progress: false | |
| jobs: | |
| unittest-run-testcase-and-build-android: | |
| runs-on: macos-latest | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Build Android Plugin # 得先构建Android插件,如果先运行UT会导致meta被Editor删除 | |
| shell: bash | |
| run: | | |
| cd unity | |
| npm i | |
| cd native_src | |
| node ../cli make --platform android --arch x64 --websocket 1 --config Debug | |
| - name: Setup Unity | |
| uses: RageAgainstThePixel/unity-setup@v1 | |
| with: | |
| unity-version: 2022.3.59f1 | |
| build-targets: StandaloneOSX, Android | |
| modules: android-il2cpp, mac-il2cpp | |
| #version-file: 'unity/test/unity/ProjectSettings/ProjectVersion.txt' | |
| - uses: RageAgainstThePixel/activate-unity-license@v1 | |
| with: | |
| license: 'Personal' | |
| username: ${{ secrets.UNITY_USERNAME }} | |
| password: ${{ secrets.UNITY_PASSWORD }} | |
| #serial: ${{ secrets.UNITY_SERIAL }} | |
| - name: UnitTest | |
| run: | | |
| cd unity | |
| npm i | |
| cd test/unity | |
| node ../../cli unity-test --unity ${{ env.UNITY_EDITOR_PATH }} | |
| - name: TestResult | |
| if: always() | |
| shell: bash | |
| run: | | |
| cd unity/test/unity | |
| echo "testresult in v1" | |
| cat log1.txt | grep "Failed\|Passed" | |
| echo "testresult in v2(reflection)" | |
| cat log2.txt | grep "Failed\|Passed" | |
| echo "testresult in v2" | |
| cat log3.txt | grep "Failed\|Passed" | |
| echo "testresult in v2(quickjs)" | |
| cat log4.txt | grep "Failed\|Passed" | |
| echo "testresult in v2(mult)" | |
| cat log5.txt | grep "Failed\|Passed" | |
| - name: Build Android APK | |
| shell: bash | |
| run: | | |
| cd unity/test/unity | |
| ${{ env.UNITY_EDITOR_PATH }} -batchmode -nographics -quit -projectPath . -logFile log1.txt -executeMethod TestBuilder.GenV2WithoutWrapper | |
| ${{ env.UNITY_EDITOR_PATH }} -batchmode -nographics -quit -projectPath . -logFile log2.txt -executeMethod TestBuilder.BuildAndroid | |
| - name: Upload apk | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: puerts_test | |
| path: unity/test/unity/build/puerts_test.apk | |
| unittest-run-android-in-linux: | |
| runs-on: ubuntu-latest | |
| needs: [unittest-run-testcase-and-build-android] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: puerts_test | |
| - name: Enable KVM group perms | |
| run: | | |
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
| sudo udevadm control --reload-rules | |
| sudo udevadm trigger --name-match=kvm | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 17 | |
| distribution: 'adopt' | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Start emulator and run commands | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: 24 | |
| target: default | |
| arch: x86_64 | |
| profile: Nexus 6 | |
| emulator-options: -no-window -no-boot-anim -no-audio -no-snapshot-load | |
| disable-linux-hw-accel: true | |
| script: bash .github/workflows/run_android_test.sh | |
| - name: Upload logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: logcat | |
| path: logcat.txt | |
| # unittest-osx-unity: | |
| # runs-on: macos-latest | |
| # steps: | |
| # - uses: actions/checkout@v3 | |
| # - uses: RageAgainstThePixel/unity-setup@v1 | |
| # with: | |
| # unity-version: 2022.3.59f1 | |
| # build-targets: StandaloneOSX | |
| # modules: mac-il2cpp | |
| # #version-file: 'unity/test/unity/ProjectSettings/ProjectVersion.txt' | |
| # - uses: RageAgainstThePixel/activate-unity-license@v1 | |
| # with: | |
| # license: 'Personal' | |
| # username: ${{ secrets.UNITY_USERNAME }} | |
| # password: ${{ secrets.UNITY_PASSWORD }} | |
| # #serial: ${{ secrets.UNITY_SERIAL }} | |
| # - name: UnitTest | |
| # run: | | |
| # cd unity | |
| # npm i | |
| # cd test/unity | |
| # node ../../cli unity-test --unity ${{ env.UNITY_EDITOR_PATH }} | |
| # - name: TestResult | |
| # if: always() | |
| # shell: bash | |
| # run: | | |
| # cd unity/test/unity | |
| # echo "testresult in v1" | |
| # cat log1.txt | grep "Failed\|Passed" | |
| # echo "testresult in v2(reflection)" | |
| # cat log2.txt | grep "Failed\|Passed" | |
| # echo "testresult in v2" | |
| # cat log3.txt | grep "Failed\|Passed" | |
| # echo "testresult in v2(quickjs)" | |
| # cat log4.txt | grep "Failed\|Passed" | |
| # echo "testresult in v2(mult)" | |
| # cat log5.txt | grep "Failed\|Passed" | |
| unittest-win-dotnet: | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: '6.x.x' | |
| - uses: actions/checkout@v3 | |
| - name: UnitTest-v8 | |
| run: | | |
| cd unity | |
| npm i | |
| cd test/dotnet | |
| node ../../cli dotnet-test v8_9.4 | |
| - name: UnitTest-v8-10-6 | |
| run: | | |
| cd unity | |
| npm i | |
| cd test/dotnet | |
| node ../../cli dotnet-test v8_10.6.194 | |
| - name: UnitTest-nodejs | |
| run: | | |
| cd unity/test/dotnet | |
| node ../../cli dotnet-test nodejs_16 | |
| - name: UnitTest-quickjs | |
| run: | | |
| cd unity/test/dotnet | |
| node ../../cli dotnet-test quickjs | |
| - name: UnitTest-mult-v8 | |
| run: | | |
| cd unity/test/dotnet | |
| node ../../cli dotnet-test mult | |
| - name: UnitTest-mult-v8-qjs | |
| run: | | |
| cd unity/test/dotnet | |
| node ../../cli dotnet-test mult -sq | |
| - name: UnitTest-v8-ts | |
| run: | | |
| cd unity/test/dotnet | |
| node ../../cli dotnet-test v8_9.4 -ts | |
| unittest-osx-dotnet: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: '6.x.x' | |
| - uses: actions/checkout@v3 | |
| - name: UnitTest-v8 | |
| run: | | |
| cd unity | |
| npm i | |
| cd test/dotnet | |
| node ../../cli dotnet-test v8_9.4 | |
| - name: UnitTest-v8-10-6 | |
| run: | | |
| cd unity | |
| npm i | |
| cd test/dotnet | |
| node ../../cli dotnet-test v8_10.6.194 | |
| - name: UnitTest-nodejs | |
| run: | | |
| cd unity/test/dotnet | |
| node ../../cli dotnet-test nodejs_16 | |
| - name: UnitTest-quickjs | |
| run: | | |
| cd unity/test/dotnet | |
| node ../../cli dotnet-test quickjs | |
| - name: UnitTest-mult-v8 | |
| run: | | |
| cd unity/test/dotnet | |
| node ../../cli dotnet-test mult | |
| - name: UnitTest-mult-v8-qjs | |
| run: | | |
| cd unity/test/dotnet | |
| node ../../cli dotnet-test mult -sq | |
| - name: UnitTest-v8-ts | |
| run: | | |
| cd unity/test/dotnet | |
| node ../../cli dotnet-test v8_9.4 -ts | |
| unittest-linux-dotnet: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: '6.x.x' | |
| - uses: actions/checkout@v3 | |
| - name: Install LibC++ | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install clang | |
| sudo apt-get install build-essential | |
| sudo apt-get install libc++-dev | |
| sudo apt-get install libc++abi-dev | |
| - name: UnitTest-v8 | |
| run: | | |
| cd unity | |
| npm i | |
| cd test/dotnet | |
| node ../../cli dotnet-test v8_9.4 | |
| - name: UnitTest-v8-10-6 | |
| run: | | |
| cd unity | |
| npm i | |
| cd test/dotnet | |
| node ../../cli dotnet-test v8_10.6.194 | |
| - name: UnitTest-nodejs | |
| run: | | |
| cd unity/test/dotnet | |
| node ../../cli dotnet-test nodejs_16 | |
| - name: UnitTest-quickjs | |
| run: | | |
| cd unity/test/dotnet | |
| node ../../cli dotnet-test quickjs | |
| - name: UnitTest-mult-v8 | |
| run: | | |
| cd unity/test/dotnet | |
| node ../../cli dotnet-test mult | |
| - name: UnitTest-mult-v8-qjs | |
| run: | | |
| cd unity/test/dotnet | |
| node ../../cli dotnet-test mult -sq | |
| - name: UnitTest-v8-ts | |
| run: | | |
| cd unity/test/dotnet | |
| node ../../cli dotnet-test v8_9.4 -ts |