diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b4e807929..183be514a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,8 +65,8 @@ jobs: testdemos: name: 'Test demos' - runs-on: ubuntu-20.04 - container: s1lentq/testdemos:latest + runs-on: ubuntu-latest + container: rehldsorg/testdemos:latest needs: [windows] env: @@ -77,7 +77,13 @@ jobs: defaults: run: shell: bash - working-directory: ../../../opt/HLDS + + strategy: + fail-fast: false + matrix: + test: [ + { file: 'cstrike-basic-1', desc: 'CS: Testing jumping, scenarios, shooting etc' }, + ] steps: - name: Deploying windows artifacts @@ -85,51 +91,17 @@ jobs: with: name: win32 - - name: Play demos + - name: Setup dependencies 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 + - name: Play test + env: + demo: ${{ matrix.test.file }} + desc: ${{ matrix.test.desc }} + run: ./runTest.sh linux: name: 'Linux'