Multi-Map Testing

This commit is contained in:
ItsSelis
2022-07-02 22:02:37 +02:00
parent 594a1f8317
commit 0eeceaeaba
2 changed files with 17 additions and 1 deletions
+8 -1
View File
@@ -53,7 +53,11 @@ jobs:
outputFile: output-annotations.txt
unit_tests:
name: Integration Tests
strategy:
matrix:
map: ['tether', 'stellardelight', 'groundbase']
name: Integration Tests (${{ matrix.map }})
needs: ['file_tests', 'dreamchecker']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
@@ -78,6 +82,7 @@ jobs:
env:
TEST_DEFINE: "UNIT_TEST"
TEST_FILE: "code/_unit_tests.dm"
MAP: ${{ matrix.map }}
RUN: "1"
- name: Compile POIs (no run)
run: |
@@ -86,6 +91,7 @@ jobs:
env:
TEST_DEFINE: "MAP_TEST"
TEST_FILE: "code/_map_tests.dm"
MAP: ${{ matrix.map }}
RUN: "0"
- name: Compile away missions (no run)
run: |
@@ -94,4 +100,5 @@ jobs:
env:
TEST_DEFINE: "AWAY_MISSION_TEST"
TEST_FILE: "code/_away_mission_tests.dm"
MAP: ${{ matrix.map }}
RUN: "0"
+9
View File
@@ -11,6 +11,15 @@ cp config/example/* config/
# Define any unit test defines that need to run
echo "#define ${TEST_DEFINE} 1" > ${TEST_FILE}
# Messy map compile code
if grep -Fxq "#include \"maps\tether\tether.dm\"" $BASENAME.dme then
sed -i "/#include \"maps\tether\tether.dm\"/c\\#include \"maps\\${MAP}\\${MAP}.dm\"" $BASENAME.dme
elif grep -Fxq "#include \"maps\stellardelight\stellardelight.dm\"" $BASENAME.dme then
sed -i "/#include \"maps\stellardelight\stellardelight.dm\"/c\\#include \"maps\\${MAP}\\${MAP}.dm\"" $BASENAME.dme
elif grep -Fxq "#include \"maps\groundbase\groundbase.dm\"" $BASENAME.dme then
sed -i "/#include \"maps\groundbase\groundbase.dm\"/c\\#include \"maps\\${MAP}\\${MAP}.dm\"" $BASENAME.dme
fi
# Compile a copy of the codebase, and print errors as Github Actions annotations
DreamMaker $BASENAME.dme > compile.log
exitVal=$?