From bb5152db0bad091b45562d6525af513c9b90dd2b Mon Sep 17 00:00:00 2001 From: s1lentq Date: Mon, 9 Jan 2023 20:59:46 +0700 Subject: [PATCH] CI Build remove unittest Fix linux compile --- .github/workflows/build.yml | 106 +----------------------------------- regamedll/dlls/player.cpp | 2 +- 2 files changed, 2 insertions(+), 106 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b0b0fa710..c09881b7e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,8 +20,6 @@ jobs: solution: 'msvc/ReGameDLL.sln' buildPlatform: 'Win32' buildRelease: 'Release' - buildReleasePlay: 'Release Play' - buildTests: 'Tests' steps: - name: Checkout @@ -42,26 +40,14 @@ jobs: with: vs-version: '16.8' - - name: Build and Run unittests - run: | - msbuild ${{ env.solution }} -p:Configuration="${{ env.buildTests }}" /t:Clean,Build /p:Platform=${{ env.buildPlatform }} /p:PlatformToolset=v140_xp /p:XPDeprecationWarning=false - .\"msvc\Tests\mp.exe" - If ($LASTEXITCODE -ne 0 -And - $LASTEXITCODE -ne 3) - {[Environment]::Exit(1)} - shell: "pwsh" - - name: Build run: | msbuild ${{ env.solution }} -p:Configuration="${{ env.buildRelease }}" /t:Clean,Build /p:Platform=${{ env.buildPlatform }} /p:PlatformToolset=v140_xp /p:XPDeprecationWarning=false - msbuild ${{ env.solution }} -p:Configuration="${{ env.buildReleasePlay }}" /t:Clean,Build /p:Platform=${{ env.buildPlatform }} /p:PlatformToolset=v140_xp /p:XPDeprecationWarning=false - name: Move files run: | mkdir publish\debug - mkdir publish\tests mkdir publish\bin\win32\cstrike\dlls - move "msvc\${{ env.buildReleasePlay }}\mp.dll" publish\tests\mp.dll move msvc\${{ env.buildRelease }}\mp.dll publish\bin\win32\cstrike\dlls\mp.dll move msvc\${{ env.buildRelease }}\mp.pdb publish\debug\mp.pdb @@ -71,73 +57,6 @@ jobs: name: win32 path: publish/* - testdemos: - name: 'Test demos' - runs-on: ubuntu-latest - container: s1lentq/testdemos:latest - needs: [windows] - - env: - WINEDEBUG: -all - WINEDLLOVERRIDES: mshtml= - - defaults: - run: - shell: bash - working-directory: ../../../opt/HLDS - - steps: - - name: Deploying windows artifacts - uses: actions/download-artifact@v2 - with: - name: win32 - - - name: Play demos - run: | - chown root ~ - rsync -a deps/regamedll/* . - mv $GITHUB_WORKSPACE/tests/mp.dll cstrike/dlls/mp.dll - - descs=( - "CS: Testing jumping, scenarios, shooting etc" - ) - - demos=( - "cstrike-basic-1" - ) - - retVal=0 - for i in "${!demos[@]}"; do - params=$(cat "testdemos/${demos[i]}.params") - - echo -e "\e[1m[$((i + 1))/${#demos[@]}] \e[1;36m${descs[i]} testing...\e[0m" - echo -e " - \e[0;33mParameters $params\e[0m" - - wine hlds.exe --rehlds-enable-all-hooks --rehlds-test-play "testdemos/${demos[i]}.bin" $params &> result.log || retVal=$? - - if [ $retVal -ne 777 ] && [ $retVal -ne 9 ]; then - # Print with catchy messages - while read line; do - echo -e " \e[0;33m$line" - done <<< $(cat result.log | sed '0,/demo failed/I!d;/wine:/d;/./,$!d') - - echo " 🔸 🔸 🔸 🔸 🔸 🔸 🔸 🔸 🔸 🔸" - while read line; do - echo -e " \e[1;31m$line"; - done < rehlds_demo_error.txt - echo -e " \e[30;41mExit code: $retVal\e[0m" - echo -e "\e[1m[$((i + 1))/${#demos[@]}] \e[1;36m${descs[i]} testing...\e[1;31m Failed ❌" - exit 6 # Test demo failed - else - # Print result HLDS console - while read line; do - echo -e " \e[0;33m$line" - done <<< $(cat result.log | sed '/wine:/d;/./,$!d') - echo -e " \e[30;43mExit code: $retVal\e[0m" - echo -e "\e[1m[$((i + 1))/${#demos[@]}] \e[1;36m${descs[i]} testing...\e[1;32m Succeed ✔" - fi - done - linux: name: 'Linux' runs-on: ubuntu-latest @@ -150,29 +69,6 @@ jobs: fetch-depth: 0 submodules: true - - name: Build and Run unittests - run: | - rm -rf build && CC=icc CXX=icpc cmake -DCMAKE_BUILD_TYPE=Unittests -B build && cmake --build build -j8 - retVal=0 - ./build/regamedll/cs 2> /dev/null > result.log || retVal=$? - while read line; do - if [[ ${line} == *"Warning in test"* ]] ; then - echo -e "\e[2;38m$line" - elif [[ ${line} == *"Failure in test"* ]] ; then - echo -e "\e[1;31m$line" - else - echo -e "\e[0;33m$line" - fi - done <<< $(cat result.log) - - if [ $retVal -ne 0 ] && [ $retVal -ne 3 ]; then - echo -e "\e[30;41mExit code: $retVal\e[0m" - exit 1 # Unittest failed - else - echo -e "\e[30;43mExit code: $retVal\e[0m" - fi - shell: bash - - name: Build using Intel C++ Compiler 19.0 run: | rm -rf build-icc && CC=icc CXX=icpc cmake -B build-icc && cmake --build build-icc -j8 @@ -222,7 +118,7 @@ jobs: publish: name: 'Publish' runs-on: ubuntu-latest - needs: [windows, testdemos, linux] + needs: [windows, linux] steps: - name: Deploying linux artifacts diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index ad935eb30..4d1d10c20 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -7928,7 +7928,7 @@ CBaseEntity *EXT_FUNC CBasePlayer::__API_HOOK(DropPlayerItem)(const char *pszIte break; } #else - auto pWeapon = pszItemName ? GetItemByName(pszItemName) : m_hActiveItem; + CBasePlayerItem *pWeapon = pszItemName ? GetItemByName(pszItemName) : m_hActiveItem.GetPtr(); #endif if (pWeapon) {