@@ -34,19 +34,15 @@ jobs:
34
34
with :
35
35
nuget-api-key : ${{ secrets.NuGetAPIKey }}
36
36
nuget-version : ' 5.x'
37
+
37
38
- run : nuget restore '${{ env.solution }}'
38
39
39
40
- name : Setup MSBuild
40
41
41
42
with :
42
43
vs-version : ' 16.8'
43
44
44
- - name : Build ReHLDS
45
- run : |
46
- msbuild ${{ env.solution }} -p:Configuration="${{ env.buildRelease }}" /t:Clean,Build /p:Platform=${{ env.buildPlatform }} /p:PlatformToolset=v140_xp /p:XPDeprecationWarning=false
47
- msbuild ${{ env.solution }} -p:Configuration="${{ env.buildReleasePlay }}" /t:Clean,Build /p:Platform=${{ env.buildPlatform }} /p:PlatformToolset=v140_xp /p:XPDeprecationWarning=false
48
-
49
- - name : Build and Testing
45
+ - name : Build and Run unittests
50
46
run : |
51
47
msbuild ${{ env.solution }} -p:Configuration="${{ env.buildTest }}" /t:Clean,Build /p:Platform=${{ env.buildPlatform }} /p:PlatformToolset=v140_xp /p:XPDeprecationWarning=false
52
48
.\"msvc\Test Fixes\swds.exe"
55
51
{[Environment]::Exit(1)}
56
52
shell : " pwsh"
57
53
54
+ - name : Build
55
+ run : |
56
+ msbuild ${{ env.solution }} -p:Configuration="${{ env.buildRelease }}" /t:Clean,Build /p:Platform=${{ env.buildPlatform }} /p:PlatformToolset=v140_xp /p:XPDeprecationWarning=false
57
+ msbuild ${{ env.solution }} -p:Configuration="${{ env.buildReleasePlay }}" /t:Clean,Build /p:Platform=${{ env.buildPlatform }} /p:PlatformToolset=v140_xp /p:XPDeprecationWarning=false
58
+
58
59
- name : Move files
59
60
run : |
60
61
mkdir publish\debug
@@ -112,17 +113,17 @@ jobs:
112
113
mv $GITHUB_WORKSPACE/tests/swds.dll .
113
114
114
115
descs=(
116
+ "CS: Multiplayer"
115
117
"Half-Life: Physics singleplayer"
116
118
"Half-Life: Multiplayer on crossfire map"
117
119
"Half-Life: Shooting with several weapons"
118
- "CS: Multiplayer"
119
120
)
120
121
121
122
demos=(
123
+ "cstrike-muliplayer-1"
122
124
"rehlds-phys-single1"
123
125
"crossfire-1-multiplayer-1"
124
126
"shooting-hl-1"
125
- "cstrike-muliplayer-1"
126
127
)
127
128
128
129
retVal=0
@@ -168,6 +169,30 @@ jobs:
168
169
with :
169
170
fetch-depth : 0
170
171
172
+ - name : Build and Run unittests
173
+ run : |
174
+ rm -rf build && CC=icc CXX=icpc cmake -DCMAKE_BUILD_TYPE=Unittests -B build && cmake --build build -j8
175
+ retVal=0
176
+ export LD_LIBRARY_PATH="rehlds/lib/linux32:$LD_LIBRARY_PATH"
177
+ ./build/rehlds/engine_i486 2> /dev/null > result.log || retVal=$?
178
+ while read line; do
179
+ if [[ ${line} == *"Warning in test"* ]] ; then
180
+ echo -e "\e[2;38m$line"
181
+ elif [[ ${line} == *"Failure in test"* ]] ; then
182
+ echo -e "\e[1;31m$line"
183
+ else
184
+ echo -e "\e[0;33m$line"
185
+ fi
186
+ done <<< $(cat result.log)
187
+
188
+ if [ $retVal -ne 0 ] && [ $retVal -ne 3 ]; then
189
+ echo -e "\e[30;41mExit code: $retVal\e[0m"
190
+ exit 1 # Unittest failed
191
+ else
192
+ echo -e "\e[30;43mExit code: $retVal\e[0m"
193
+ fi
194
+ shell : bash
195
+
171
196
- name : Build using Intel C++ Compiler
172
197
run : |
173
198
rm -rf build && CC=icc CXX=icpc cmake -B build && cmake --build build -j8
@@ -244,14 +269,14 @@ jobs:
244
269
- name : Reading appversion.h
245
270
run : |
246
271
if [ -e appversion.h ]; then
247
- APP_VERSION=$(cat appversion.h | grep -wi '#define APP_VERSION_STRD' | sed -e 's/#define APP_VERSION_STRD[ \t\r\n\v\f]\+\(.*\)/\1/i' -e 's/\r//g')
248
- if [ $? -ne 0 ]; then
249
- APP_VERSION=""
250
- else
251
- # Remove quotes
252
- APP_VERSION=$(echo $APP_VERSION | xargs)
253
- echo "APP_VERSION=${APP_VERSION}" >> $GITHUB_ENV
254
- fi
272
+ APP_VERSION=$(cat appversion.h | grep -wi '#define APP_VERSION_STRD' | sed -e 's/#define APP_VERSION_STRD[ \t\r\n\v\f]\+\(.*\)/\1/i' -e 's/\r//g')
273
+ if [ $? -ne 0 ]; then
274
+ APP_VERSION=""
275
+ else
276
+ # Remove quotes
277
+ APP_VERSION=$(echo $APP_VERSION | xargs)
278
+ echo "APP_VERSION=${APP_VERSION}" >> $GITHUB_ENV
279
+ fi
255
280
fi
256
281
rm -f appversion.h
257
282
0 commit comments