Skip to content

Commit

Permalink
GHA: -Werror only for amici repo
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dweindl committed Jul 8, 2024
1 parent 837e70b commit 6e3081a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion python/sdist/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()}",
Expand Down
2 changes: 1 addition & 1 deletion scripts/buildAmici.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6e3081a

Please sign in to comment.