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

[ci] speed up conda setup for macOS and Linux jobs #5743

Merged
merged 3 commits into from
Feb 26, 2023
Merged
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
16 changes: 8 additions & 8 deletions .ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,9 @@ if [[ $TASK == "lint" ]]; then
exit 0
fi

conda create -q -y -n $CONDA_ENV "${CONDA_PYTHON_REQUIREMENT}"
source activate $CONDA_ENV

cd $BUILD_DIRECTORY

if [[ $TASK == "check-docs" ]] || [[ $TASK == "check-links" ]]; then
cd $BUILD_DIRECTORY/docs
conda env update \
conda env create \
-n $CONDA_ENV \
--file ./env.yml || exit -1
conda install \
Expand All @@ -109,6 +104,7 @@ if [[ $TASK == "check-docs" ]] || [[ $TASK == "check-links" ]]; then
-n $CONDA_ENV \
doxygen \
'rstcheck>=6.0.0' || exit -1
source activate $CONDA_ENV
# check reStructuredText formatting
cd $BUILD_DIRECTORY/python-package
rstcheck --report-level warning $(find . -type f -name "*.rst") || exit -1
Expand All @@ -131,8 +127,8 @@ if [[ $TASK == "check-docs" ]] || [[ $TASK == "check-links" ]]; then
exit 0
fi

# re-including python=version[build=*cpython] to ensure that conda doesn't fall back to pypy
conda install -q -y -n $CONDA_ENV \
# including python=version[build=*cpython] to ensure that conda doesn't fall back to pypy
conda create -q -y -n $CONDA_ENV \
cloudpickle \
dask-core \
distributed \
Expand All @@ -147,6 +143,10 @@ conda install -q -y -n $CONDA_ENV \
scikit-learn \
scipy || exit -1

source activate $CONDA_ENV

cd $BUILD_DIRECTORY

if [[ $OS_NAME == "macos" ]] && [[ $COMPILER == "clang" ]]; then
# fix "OMP: Error #15: Initializing libiomp5.dylib, but found libomp.dylib already initialized." (OpenMP library conflict due to conda's MKL)
for LIBOMP_ALIAS in libgomp.dylib libiomp5.dylib libomp.dylib; do sudo ln -sf "$(brew --cellar libomp)"/*/lib/libomp.dylib $CONDA_PREFIX/lib/$LIBOMP_ALIAS || exit -1; done
Expand Down