Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialize game and test build to ease pressure on RAM, especially in CI #73793

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@
# make RUNTESTS=1
# Build source files in order of how often the matching header is included
# make HEADERPOPULARITY=1
# Serializing the game and test sub-builds avoids putting pressure on memory
# make SERIALIZE_TEST_BUILD=1

# comment these to toggle them as one sees fit.
# DEBUG is best turned on if you plan to debug in gdb -- please do!
Expand Down Expand Up @@ -220,12 +222,22 @@ endif

# Can't run tests if we aren't going to build them
ifeq ($(TESTS), 1)
ifeq ($(RUNTESTS), 1)
# Build and run the tests
TESTSTARGET = check
ifeq ($(SERIALIZE_TEST_BUILD), 1)
ifeq ($(RUNTESTS), 1)
# Build and run the tests, sequentially with the game
TESTSTARGET = check-no-parallel
else
# Only build the tests, sequentially with the game
TESTSTARGET = tests-no-parallel
endif
else
# Only build the tests
TESTSTARGET = tests
ifeq ($(RUNTESTS), 1)
# Build and run the tests
TESTSTARGET = check
else
# Only build the tests
TESTSTARGET = tests
endif
endif
endif

Expand Down Expand Up @@ -1392,12 +1404,18 @@ $(JSON_FORMATTER_BIN): $(JSON_FORMATTER_SOURCES)
python-check:
flake8

tests: version $(BUILD_PREFIX)cataclysm.a $(LOCALIZE_TEST_DEPS)
tests: version $(BUILD_PREFIX)cataclysm.a $(LOCALIZE_TEST_DEPS) | $(TARGET)
$(MAKE) -C tests

tests-no-parallel: version $(BUILD_PREFIX)cataclysm.a $(LOCALIZE_TEST_DEPS) | $(TARGET)
$(MAKE) -C tests

check: version $(BUILD_PREFIX)cataclysm.a $(LOCALIZE_TEST_DEPS)
$(MAKE) -C tests check

check-no-parallel: version $(BUILD_PREFIX)cataclysm.a $(LOCALIZE_TEST_DEPS)
$(MAKE) -C tests check

clean-tests:
$(MAKE) -C tests clean

Expand Down
2 changes: 1 addition & 1 deletion build-scripts/gha_compile_only.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ then
..
make -j$num_jobs
else
make -j "$num_jobs" CCACHE=1 CROSS="$CROSS_COMPILATION" LINTJSON=0 FRAMEWORK=1 UNIVERSAL_BINARY=1 DEBUG_SYMBOLS=1
make -j "$num_jobs" CCACHE=1 CROSS="$CROSS_COMPILATION" LINTJSON=0 FRAMEWORK=1 UNIVERSAL_BINARY=1 DEBUG_SYMBOLS=1 SERIALIZE_TEST_BUILD=1

# For CI on macOS, patch the test binary so it can find SDL2 libraries.
if [[ ! -z "$OS" && "$OS" = "macos-12" ]]
Expand Down
Loading