"git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "8ebef94cfe0627aef6def578fb0e6a2e082dbf1e"
Unverified Commit 00073437 authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

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

parent 0b937d10
...@@ -93,14 +93,9 @@ if [[ $TASK == "lint" ]]; then ...@@ -93,14 +93,9 @@ if [[ $TASK == "lint" ]]; then
exit 0 exit 0
fi 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 if [[ $TASK == "check-docs" ]] || [[ $TASK == "check-links" ]]; then
cd $BUILD_DIRECTORY/docs cd $BUILD_DIRECTORY/docs
conda env update \ conda env create \
-n $CONDA_ENV \ -n $CONDA_ENV \
--file ./env.yml || exit -1 --file ./env.yml || exit -1
conda install \ conda install \
...@@ -109,6 +104,7 @@ if [[ $TASK == "check-docs" ]] || [[ $TASK == "check-links" ]]; then ...@@ -109,6 +104,7 @@ if [[ $TASK == "check-docs" ]] || [[ $TASK == "check-links" ]]; then
-n $CONDA_ENV \ -n $CONDA_ENV \
doxygen \ doxygen \
'rstcheck>=6.0.0' || exit -1 'rstcheck>=6.0.0' || exit -1
source activate $CONDA_ENV
# check reStructuredText formatting # check reStructuredText formatting
cd $BUILD_DIRECTORY/python-package cd $BUILD_DIRECTORY/python-package
rstcheck --report-level warning $(find . -type f -name "*.rst") || exit -1 rstcheck --report-level warning $(find . -type f -name "*.rst") || exit -1
...@@ -131,8 +127,8 @@ if [[ $TASK == "check-docs" ]] || [[ $TASK == "check-links" ]]; then ...@@ -131,8 +127,8 @@ if [[ $TASK == "check-docs" ]] || [[ $TASK == "check-links" ]]; then
exit 0 exit 0
fi fi
# re-including python=version[build=*cpython] to ensure that conda doesn't fall back to pypy # including python=version[build=*cpython] to ensure that conda doesn't fall back to pypy
conda install -q -y -n $CONDA_ENV \ conda create -q -y -n $CONDA_ENV \
cloudpickle \ cloudpickle \
dask-core \ dask-core \
distributed \ distributed \
...@@ -147,6 +143,10 @@ conda install -q -y -n $CONDA_ENV \ ...@@ -147,6 +143,10 @@ conda install -q -y -n $CONDA_ENV \
scikit-learn \ scikit-learn \
scipy || exit -1 scipy || exit -1
source activate $CONDA_ENV
cd $BUILD_DIRECTORY
if [[ $OS_NAME == "macos" ]] && [[ $COMPILER == "clang" ]]; then 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) # 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 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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment