From 6e3081aabd9048dbb3470b4f17cf113149d89bc2 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Mon, 8 Jul 2024 08:57:11 +0200 Subject: [PATCH] GHA: -Werror only for amici repo We have a couple of -Werror options enabled when running on GHA. However, we should also check for the repo name. If amici is used in tests of any downstream projects, we don't want errors. Also use CMake's `-Wno-dev` for non-amici-ci installations. --- python/sdist/setup.py | 4 +++- scripts/buildAmici.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/python/sdist/setup.py b/python/sdist/setup.py index 9dd268953a..d01a0ec75c 100755 --- a/python/sdist/setup.py +++ b/python/sdist/setup.py @@ -152,7 +152,9 @@ def get_extensions(): cmake_configure_options=[ *global_cmake_configure_options, "-Werror=dev" - if "GITHUB_ACTIONS" in os.environ + # Turn warnings in to errors on GitHub Actions, + # match original repo and forks with default name + if os.environ.get("GITHUB_REPOSITORY", "").endswith("/AMICI") else "-Wno-error=dev", "-DAMICI_PYTHON_BUILD_EXT_ONLY=ON", f"-DPython3_EXECUTABLE={Path(sys.executable).as_posix()}", diff --git a/scripts/buildAmici.sh b/scripts/buildAmici.sh index cb2428579c..22faece983 100755 --- a/scripts/buildAmici.sh +++ b/scripts/buildAmici.sh @@ -13,7 +13,7 @@ amici_build_dir="${amici_path}/build" mkdir -p "${amici_build_dir}" cd "${amici_build_dir}" -if [ "${GITHUB_ACTIONS:-}" = true ] || +if [[ "${GITHUB_REPOSITORY:-}" = *"/AMICI" ]] || [ "${ENABLE_AMICI_DEBUGGING:-}" = TRUE ] || [ "${ENABLE_GCOV_COVERAGE:-}" = TRUE ]; then # Running on CI server