Skip to content

Commit

Permalink
Use grouping in CI output
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Mar 5, 2025
1 parent 6f4f159 commit 7c63608
Showing 1 changed file with 45 additions and 1 deletion.
46 changes: 45 additions & 1 deletion ci-support.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,40 @@ if [[ "$GITLAB_CI" = "true" ]] && [[ "$CI_DISPOSABLE_ENVIRONMENT" = "true" ]];
fi


begin_output_group()
{
if [[ $GITHUB_ACTIONS == "true" ]]; then
echo "::group::$1"
else
echo "--------------------------------------------------------------"
echo "BEGIN $1"
echo "--------------------------------------------------------------"
fi
}


end_output_group()
{
if [[ $GITHUB_ACTIONS == "true" ]]; then
echo "::endgroup::$1"
else
echo "--------------------------------------------------------------"
echo "END $1"
echo "--------------------------------------------------------------"
fi
}


with_output_group()
{
local groupname="$1"
shift
begin_output_group "$groupname"
trap end_output_group "$groupname" RETURN
"$@"
}


rewrite_pyopencl_test()
{
if (cd ..; $PY_EXE -c 'import pyopencl as cl; import pyopencl.characterize as c; v = [c.get_pocl_version(p) for p in cl.get_platforms()]; v, = [i for i in v if i]; import sys; sys.exit(not v >= (4,0))'); then
Expand Down Expand Up @@ -240,9 +274,14 @@ handle_extra_install()
fi
}
pip_install_project()
{
with_output_group "pip install" pip_install_project_inner
}
pip_install_project_inner()
{
begin_output_group "pip install"
with_echo pip install hatchling
handle_extra_install
Expand Down Expand Up @@ -341,6 +380,11 @@ build_py_project_in_venv()
# {{{ miniconda build
install_conda_deps()
{
with_output_group "conda install" install_conda_deps_inner
}
install_conda_deps_inner()
{
print_status_message
clean_up_repo_and_working_env
Expand Down

0 comments on commit 7c63608

Please sign in to comment.