From 0ae94a16f2d27579d3d297db039be6b2220ed773 Mon Sep 17 00:00:00 2001 From: scarf Date: Sat, 3 Aug 2024 15:34:10 +0900 Subject: [PATCH] ci: fix matrix (yet again^2) (#5117) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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: `...` -> `…` --- .github/workflows/matrix.yml | 4 ++-- CMakeLists.txt | 2 +- Makefile | 2 +- build-scripts/gha_compile_only.sh | 23 +++++++++++++------- build-scripts/gha_test_only.sh | 20 +++++++++++++---- data/mods/Monster_Girls/thresh_mutation.json | 8 +++---- tests/CMakeLists.txt | 4 +++- 7 files changed, 42 insertions(+), 21 deletions(-) diff --git a/.github/workflows/matrix.yml b/.github/workflows/matrix.yml index f9365f786f50..26e728c78017 100644 --- a/.github/workflows/matrix.yml +++ b/.github/workflows/matrix.yml @@ -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 @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 543f5f986e86..072601eaa8fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 \ diff --git a/Makefile b/Makefile index 56fd35fe276c..8a5da158d0df 100644 --- a/Makefile +++ b/Makefile @@ -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 \ diff --git a/build-scripts/gha_compile_only.sh b/build-scripts/gha_compile_only.sh index b1bccef2ee2a..8ecdb20c7efa 100755 --- a/build-scripts/gha_compile_only.sh +++ b/build-scripts/gha_compile_only.sh @@ -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" ] @@ -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 @@ -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 diff --git a/build-scripts/gha_test_only.sh b/build-scripts/gha_test_only.sh index 5344c844229c..171d275f4f22 100755 --- a/build-scripts/gha_test_only.sh +++ b/build-scripts/gha_test_only.sh @@ -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 @@ -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 diff --git a/data/mods/Monster_Girls/thresh_mutation.json b/data/mods/Monster_Girls/thresh_mutation.json index 43e90e239430..c20f07eff7a3 100644 --- a/data/mods/Monster_Girls/thresh_mutation.json +++ b/data/mods/Monster_Girls/thresh_mutation.json @@ -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, @@ -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, @@ -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, @@ -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, diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 3796a08628f0..ac3d1edbaca7 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -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 "$ --rng-seed time" @@ -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 "$ --rng-seed time"