Skip to content

Commit

Permalink
ci: fix matrix (yet again^2) (#5117)
Browse files Browse the repository at this point in the history
* build: add include directory for test

for some reason it worked with ninja+tiles but not with makefile+curses

* ci: verbose env output when building

* ci: disable failing cmake config for mac

* build: fix yet another missed out cataclysm rename executable

i love renames

* build: apply shellcheck fixes

* build: more verbose testing

* ci: fallback to makefile for curses

* build: remove `Werror`

be less strict because it feels weird to fail from warnings, it could be addressed with code reviews anyways

* fix: `...` -> `…`
  • Loading branch information
scarf005 authored Aug 3, 2024
1 parent 039c219 commit 0ae94a1
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- title: GCC 12, Ubuntu, Curses
compiler: g++-12
os: ubuntu-22.04
cmake: 1
cmake: 0
tiles: 0
sound: 0
lua: 0
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
- title: Clang 14, macOS 12, Tiles, Sound, Localize, Lua
compiler: clang++
os: macos-12
cmake: 1
cmake: 0
tiles: 1
sound: 1
lua: 1
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ message(STATUS "See CMake compiling guide for details and more info --")

if (NOT MSVC)
set(CATA_WARNINGS
"-Werror -Wall -Wextra \
"-Wall -Wextra \
-Wformat-signedness \
-Wlogical-op \
-Wmissing-declarations \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
# RELEASE_FLAGS is flags for release builds.
RELEASE_FLAGS =
WARNINGS = \
-Werror -Wall -Wextra \
-Wall -Wextra \
-Wformat-signedness \
-Wlogical-op \
-Wmissing-declarations \
Expand Down
23 changes: 15 additions & 8 deletions build-scripts/gha_compile_only.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ ccache --zero-stats
ccache -M 5G
ccache --show-stats

echo "CMAKE: $CMAKE, COMPILER: $COMPILER, OS: $OS, TILES: $TILES, SOUND: $SOUND, LUA: $LUA, TEST_STAGE: $TEST_STAGE"
echo "LANGUAGES: $LANGUAGES, LIBBACKTRACE: $LIBBACKTRACE, NATIVE: $NATIVE, RELEASE: $RELEASE, CROSS_COMPILATION: $CROSS_COMPILATION"

if [ "$CMAKE" = "1" ]
then
if [ "$RELEASE" = "1" ]
Expand All @@ -36,19 +39,23 @@ then
build_type=Debug
fi

mkdir build
cd build
echo "Building with CMake"
TILES="${TILES:-0}"
CURSES=$((1 - TILES))

mkdir -p build
cmake \
-B build \
-DBACKTRACE=ON \
${COMPILER:+-DCMAKE_CXX_COMPILER=$COMPILER} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_BUILD_TYPE="$build_type" \
-DTILES=${TILES:-0} \
-DSOUND=${SOUND:-0} \
-DLUA=${LUA:-0} \
..
-DTILES="${TILES}" \
-DCURSES="${CURSES}" \
-DSOUND="${SOUND:-0}" \
-DLUA="${LUA:-0}"

make -j$num_jobs
make -j$num_jobs -C build
else
if [ "$OS" == "macos-12" ]
then
Expand All @@ -66,7 +73,7 @@ else
if [[ ! -z "$OS" && "$OS" = "macos-12" ]]
then
file tests/cata_test
install_name_tool -add_rpath $HOME/Library/Frameworks tests/cata_test
install_name_tool -add_rpath "$HOME"/Library/Frameworks tests/cata_test
fi
fi

Expand Down
20 changes: 16 additions & 4 deletions build-scripts/gha_test_only.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,27 @@ then
build_type=Debug
fi

# Run regular tests
[ -f "${bin_path}cata_test" ] && parallel ${parallel_opts} "run_test $(printf %q "${bin_path}")'/cata_test' '('{}')=> ' --user-dir=test_user_dir_{#} {}" ::: "[slow] ~starting_items" "~[slow] ~[.],starting_items"
[ -f "${bin_path}cata_test-tiles" ] && parallel ${parallel_opts} "run_test $(printf %q "${bin_path}")'/cata_test-tiles' '('{}')=> ' --user-dir=test_user_dir_{#} {}" ::: "[slow] ~starting_items" "~[slow] ~[.],starting_items"
if [ -f "${bin_path}cata_test" ]
then
echo "running curses tests"
# shellcheck disable=SC2086
parallel ${parallel_opts} "run_test $(printf %q "${bin_path}")'/cata_test' '('{}')=> ' --user-dir=test_user_dir_{#} {}" ::: "[slow] ~starting_items" "~[slow] ~[.],starting_items"
echo "done running curses tests"
elif [ -f "${bin_path}cata_test-tiles" ]
then
echo "running tiles tests"
# shellcheck disable=SC2086
parallel ${parallel_opts} "run_test $(printf %q "${bin_path}")'/cata_test-tiles' '('{}')=> ' --user-dir=test_user_dir_{#} {}" ::: "[slow] ~starting_items" "~[slow] ~[.],starting_items"
echo "done running tiles tests"
fi
else
export ASAN_OPTIONS=detect_odr_violation=1
export UBSAN_OPTIONS=print_stacktrace=1
# shellcheck disable=SC2086
parallel -j "$num_jobs" ${parallel_opts} "run_test './tests/cata_test' '('{}')=> ' --user-dir=test_user_dir_{#} {}" ::: "[slow] ~starting_items" "~[slow] ~[.],starting_items"
if [ -n "$MODS" ]
then
# shellcheck disable=SC2086
parallel -j "$num_jobs" ${parallel_opts} "run_test './tests/cata_test' 'Mods-('{}')=> ' $(printf %q "${MODS}") --user-dir=modded_{#} {}" ::: "[slow] ~starting_items" "~[slow] ~[.],starting_items"
fi

Expand All @@ -68,7 +80,7 @@ else
# just to verify that all the mod data can be successfully loaded.
# Because some mods might be mutually incompatible we might need to run a few times.
blacklist=build-scripts/mod_test_blacklist
if [ "$LUA" == "1"]
if [ "$LUA" == "1" ]
then
do_lua="1"
else
Expand Down
8 changes: 4 additions & 4 deletions data/mods/Monster_Girls/thresh_mutation.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"id": "THRESH_NEKO",
"name": { "str": "Nekomimi" },
"points": 1,
"description": "The age of man has ended, the age of catgirls is upon us! After becoming a neko, you've found yourself wanting to... open a bakery?",
"description": "The age of man has ended, the age of catgirls is upon us! After becoming a neko, you've found yourself wanting to open a bakery?",
"valid": false,
"purifiable": false,
"threshold": true,
Expand All @@ -15,7 +15,7 @@
"id": "THRESH_DOGGIRL",
"name": { "str": "Inumimi" },
"points": 1,
"description": "Humanity has gone from taming dogs to becoming them! You've acquired a sudden desire to... become a witch?",
"description": "Humanity has gone from taming dogs to becoming them! You've acquired a sudden desire to become a witch?",
"valid": false,
"purifiable": false,
"threshold": true,
Expand Down Expand Up @@ -48,7 +48,7 @@
"id": "THRESH_MOUSEGIRL",
"name": { "str": "Nezumimi" },
"points": 1,
"description": "You initially found yourself worried about what others might think of you now... fortunately, they're very cheesed to meet you!",
"description": "You initially found yourself worried about what others might think of you now fortunately, they're very cheesed to meet you!",
"valid": false,
"purifiable": false,
"threshold": true,
Expand Down Expand Up @@ -92,7 +92,7 @@
"id": "THRESH_SLIMEGIRL",
"name": { "str": "Slime" },
"points": 1,
"description": "Your anything-but-newtonian body is soo bendy and stretchy! It gives you plenty of mischevious ideas of what to do with them later... but for now, you'll have to settle for having fun returning those zombies to their grave.",
"description": "Your anything-but-newtonian body is soo bendy and stretchy! It gives you plenty of mischevious ideas of what to do with them later but for now, you'll have to settle for having fun returning those zombies to their grave.",
"valid": false,
"purifiable": false,
"threshold": true,
Expand Down
4 changes: 3 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ if (BUILD_TESTING)
if (TILES)
add_executable(cata_test-tiles ${CATACLYSM_BN_TEST_SOURCES})
target_link_libraries(cata_test-tiles PRIVATE cataclysm-bn-tiles-common)

add_test(
NAME test-tiles
COMMAND sh -c "$<TARGET_FILE:cata_test-tiles> --rng-seed time"
Expand All @@ -28,7 +29,8 @@ if (BUILD_TESTING)

if (CURSES)
add_executable(cata_test ${CATACLYSM_BN_TEST_SOURCES})
target_link_libraries(cata_test PRIVATE cataclysm-common)
target_link_libraries(cata_test PRIVATE cataclysm-bn-common)

add_test(
NAME test
COMMAND sh -c "$<TARGET_FILE:cata_test> --rng-seed time"
Expand Down

0 comments on commit 0ae94a1

Please sign in to comment.