Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
cc733f85
Unverified
Commit
cc733f85
authored
Feb 09, 2024
by
James Lamb
Committed by
GitHub
Feb 09, 2024
Browse files
[ci] ensure shell script exit codes are in range 0-255 (#6305)
parent
ecfdc76c
Changes
27
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
161 additions
and
161 deletions
+161
-161
.ci/append_comment.sh
.ci/append_comment.sh
+2
-2
.ci/check_python_dists.sh
.ci/check_python_dists.sh
+6
-6
.ci/install_opencl.ps1
.ci/install_opencl.ps1
+2
-2
.ci/lint-cpp.sh
.ci/lint-cpp.sh
+3
-3
.ci/lint-python.sh
.ci/lint-python.sh
+2
-2
.ci/rerun_workflow.sh
.ci/rerun_workflow.sh
+2
-2
.ci/set_commit_status.sh
.ci/set_commit_status.sh
+2
-2
.ci/setup.sh
.ci/setup.sh
+6
-6
.ci/test-python-oldest.sh
.ci/test-python-oldest.sh
+6
-6
.ci/test.sh
.ci/test.sh
+78
-78
.ci/test_r_package.sh
.ci/test_r_package.sh
+29
-29
.ci/test_r_package_valgrind.sh
.ci/test_r_package_valgrind.sh
+9
-9
.ci/test_windows.ps1
.ci/test_windows.ps1
+1
-1
.ci/trigger_dispatch_run.sh
.ci/trigger_dispatch_run.sh
+2
-2
.github/workflows/cuda.yml
.github/workflows/cuda.yml
+2
-2
.github/workflows/linkchecker.yml
.github/workflows/linkchecker.yml
+2
-2
.github/workflows/optional_checks.yml
.github/workflows/optional_checks.yml
+1
-1
.github/workflows/python_package.yml
.github/workflows/python_package.yml
+2
-2
.github/workflows/r_configure.yml
.github/workflows/r_configure.yml
+1
-1
.github/workflows/r_package.yml
.github/workflows/r_package.yml
+3
-3
No files found.
.ci/append_comment.sh
View file @
cc733f85
...
@@ -14,12 +14,12 @@ set -e
...
@@ -14,12 +14,12 @@ set -e
if
[
-z
"
$GITHUB_ACTIONS
"
]
;
then
if
[
-z
"
$GITHUB_ACTIONS
"
]
;
then
echo
"Must be run inside GitHub Actions CI"
echo
"Must be run inside GitHub Actions CI"
exit
-
1
exit
1
fi
fi
if
[
$#
-ne
2
]
;
then
if
[
$#
-ne
2
]
;
then
echo
"Usage:
$0
<COMMENT_ID> <BODY>"
echo
"Usage:
$0
<COMMENT_ID> <BODY>"
exit
-
1
exit
1
fi
fi
comment_id
=
$1
comment_id
=
$1
...
...
.ci/check_python_dists.sh
View file @
cc733f85
...
@@ -7,14 +7,14 @@ echo "checking Python package distributions in '${DIST_DIR}'"
...
@@ -7,14 +7,14 @@ echo "checking Python package distributions in '${DIST_DIR}'"
pip
install
\
pip
install
\
-qq
\
-qq
\
check-wheel-contents
\
check-wheel-contents
\
twine
||
exit
-
1
twine
||
exit
1
echo
"twine check..."
echo
"twine check..."
twine check
--strict
${
DIST_DIR
}
/
*
||
exit
-
1
twine check
--strict
${
DIST_DIR
}
/
*
||
exit
1
if
{
test
"
${
TASK
}
"
=
"bdist"
||
test
"
${
METHOD
}
"
=
"wheel"
;
}
;
then
if
{
test
"
${
TASK
}
"
=
"bdist"
||
test
"
${
METHOD
}
"
=
"wheel"
;
}
;
then
echo
"check-wheel-contents..."
echo
"check-wheel-contents..."
check-wheel-contents
${
DIST_DIR
}
/
*
.whl
||
exit
-
1
check-wheel-contents
${
DIST_DIR
}
/
*
.whl
||
exit
1
fi
fi
PY_MINOR_VER
=
$(
python
-c
"import sys; print(sys.version_info.minor)"
)
PY_MINOR_VER
=
$(
python
-c
"import sys; print(sys.version_info.minor)"
)
...
@@ -27,7 +27,7 @@ if [ $PY_MINOR_VER -gt 7 ]; then
...
@@ -27,7 +27,7 @@ if [ $PY_MINOR_VER -gt 7 ]; then
--ignore
'compiled-objects-have-debug-symbols,distro-too-large-compressed'
\
--ignore
'compiled-objects-have-debug-symbols,distro-too-large-compressed'
\
--max-allowed-size-uncompressed
'100M'
\
--max-allowed-size-uncompressed
'100M'
\
--max-allowed-files
800
\
--max-allowed-files
800
\
${
DIST_DIR
}
/
*
||
exit
-
1
${
DIST_DIR
}
/
*
||
exit
1
elif
{
test
$(
uname
-m
)
=
"aarch64"
;
}
;
then
elif
{
test
$(
uname
-m
)
=
"aarch64"
;
}
;
then
pydistcheck
\
pydistcheck
\
--inspect
\
--inspect
\
...
@@ -35,14 +35,14 @@ if [ $PY_MINOR_VER -gt 7 ]; then
...
@@ -35,14 +35,14 @@ if [ $PY_MINOR_VER -gt 7 ]; then
--max-allowed-size-compressed
'5M'
\
--max-allowed-size-compressed
'5M'
\
--max-allowed-size-uncompressed
'15M'
\
--max-allowed-size-uncompressed
'15M'
\
--max-allowed-files
800
\
--max-allowed-files
800
\
${
DIST_DIR
}
/
*
||
exit
-
1
${
DIST_DIR
}
/
*
||
exit
1
else
else
pydistcheck
\
pydistcheck
\
--inspect
\
--inspect
\
--max-allowed-size-compressed
'5M'
\
--max-allowed-size-compressed
'5M'
\
--max-allowed-size-uncompressed
'15M'
\
--max-allowed-size-uncompressed
'15M'
\
--max-allowed-files
800
\
--max-allowed-files
800
\
${
DIST_DIR
}
/
*
||
exit
-
1
${
DIST_DIR
}
/
*
||
exit
1
fi
fi
else
else
echo
"skipping pydistcheck (does not support Python 3.
${
PY_MINOR_VER
}
)"
echo
"skipping pydistcheck (does not support Python 3.
${
PY_MINOR_VER
}
)"
...
...
.ci/install_opencl.ps1
View file @
cc733f85
...
@@ -12,7 +12,7 @@ if (Test-Path "$installer") {
...
@@ -12,7 +12,7 @@ if (Test-Path "$installer") {
Write-Output
"Unable to download OpenCL platform installer"
Write-Output
"Unable to download OpenCL platform installer"
Write-Output
"Setting EXIT"
Write-Output
"Setting EXIT"
$host
.
SetShouldExit
(
-1
)
$host
.
SetShouldExit
(
-1
)
E
xit
-
1
e
xit
1
}
}
# Install OpenCL platform from installer executable
# Install OpenCL platform from installer executable
...
@@ -26,7 +26,7 @@ if ($property -eq $null) {
...
@@ -26,7 +26,7 @@ if ($property -eq $null) {
Get-Content
"opencl.log"
Get-Content
"opencl.log"
Write-Output
"Setting EXIT"
Write-Output
"Setting EXIT"
$host
.
SetShouldExit
(
-1
)
$host
.
SetShouldExit
(
-1
)
E
xit
-
1
e
xit
1
}
else
{
}
else
{
Write-Output
"Successfully installed OpenCL CPU platform"
Write-Output
"Successfully installed OpenCL CPU platform"
Write-Output
"Current OpenCL drivers:"
Write-Output
"Current OpenCL drivers:"
...
...
.ci/lint-cpp.sh
View file @
cc733f85
...
@@ -4,7 +4,7 @@ echo "running cpplint"
...
@@ -4,7 +4,7 @@ echo "running cpplint"
cpplint
\
cpplint
\
--filter
=
-build
/c++11,-build/include_subdir,-build/header_guard,-whitespace/line_length
\
--filter
=
-build
/c++11,-build/include_subdir,-build/header_guard,-whitespace/line_length
\
--recursive
./src ./include ./R-package ./swig ./tests
\
--recursive
./src ./include ./R-package ./swig ./tests
\
||
exit
-
1
||
exit
1
echo
"done running cpplint"
echo
"done running cpplint"
echo
"running cmakelint"
echo
"running cmakelint"
...
@@ -16,7 +16,7 @@ cmakelint \
...
@@ -16,7 +16,7 @@ cmakelint \
--linelength
=
120
\
--linelength
=
120
\
--filter
=
-convention
/filename,-package/stdargs,-readability/wonkycase
\
--filter
=
-convention
/filename,-package/stdargs,-readability/wonkycase
\
${
cmake_files
}
\
${
cmake_files
}
\
||
exit
-
1
||
exit
1
echo
"done running cmakelint"
echo
"done running cmakelint"
echo
"checking that all OpenMP pragmas specify num_threads()"
echo
"checking that all OpenMP pragmas specify num_threads()"
...
@@ -39,6 +39,6 @@ if test "${PROBLEMATIC_LINES}" != ""; then
...
@@ -39,6 +39,6 @@ if test "${PROBLEMATIC_LINES}" != ""; then
get_omp_pragmas_without_num_threads
get_omp_pragmas_without_num_threads
echo
"Found '#pragma omp parallel' not using explicit num_threads() configuration. Fix those."
echo
"Found '#pragma omp parallel' not using explicit num_threads() configuration. Fix those."
echo
"For details, see https://www.openmp.org/spec-html/5.0/openmpse14.html#x54-800002.6"
echo
"For details, see https://www.openmp.org/spec-html/5.0/openmpse14.html#x54-800002.6"
exit
-
1
exit
1
fi
fi
echo
"done checking OpenMP pragmas"
echo
"done checking OpenMP pragmas"
.ci/lint-python.sh
View file @
cc733f85
...
@@ -4,7 +4,7 @@ echo "running ruff"
...
@@ -4,7 +4,7 @@ echo "running ruff"
ruff check
\
ruff check
\
--config
=
./python-package/pyproject.toml
\
--config
=
./python-package/pyproject.toml
\
.
\
.
\
||
exit
-
1
||
exit
1
echo
"done running ruff"
echo
"done running ruff"
echo
"running isort"
echo
"running isort"
...
@@ -12,7 +12,7 @@ isort \
...
@@ -12,7 +12,7 @@ isort \
--check-only
\
--check-only
\
--settings-path
=
./python-package/pyproject.toml
\
--settings-path
=
./python-package/pyproject.toml
\
.
\
.
\
||
exit
-
1
||
exit
1
echo
"done running isort"
echo
"done running isort"
echo
"running mypy"
echo
"running mypy"
...
...
.ci/rerun_workflow.sh
View file @
cc733f85
...
@@ -16,12 +16,12 @@ set -e
...
@@ -16,12 +16,12 @@ set -e
if
[
-z
"
$GITHUB_ACTIONS
"
]
;
then
if
[
-z
"
$GITHUB_ACTIONS
"
]
;
then
echo
"Must be run inside GitHub Actions CI"
echo
"Must be run inside GitHub Actions CI"
exit
-
1
exit
1
fi
fi
if
[
$#
-ne
3
]
;
then
if
[
$#
-ne
3
]
;
then
echo
"Usage:
$0
<WORKFLOW_ID> <PR_NUMBER> <PR_BRANCH>"
echo
"Usage:
$0
<WORKFLOW_ID> <PR_NUMBER> <PR_BRANCH>"
exit
-
1
exit
1
fi
fi
workflow_id
=
$1
workflow_id
=
$1
...
...
.ci/set_commit_status.sh
View file @
cc733f85
...
@@ -18,12 +18,12 @@ set -e
...
@@ -18,12 +18,12 @@ set -e
if
[
-z
"
$GITHUB_ACTIONS
"
]
;
then
if
[
-z
"
$GITHUB_ACTIONS
"
]
;
then
echo
"Must be run inside GitHub Actions CI"
echo
"Must be run inside GitHub Actions CI"
exit
-
1
exit
1
fi
fi
if
[
$#
-ne
3
]
;
then
if
[
$#
-ne
3
]
;
then
echo
"Usage:
$0
<NAME> <STATUS> <SHA>"
echo
"Usage:
$0
<NAME> <STATUS> <SHA>"
exit
-
1
exit
1
fi
fi
name
=
$1
name
=
$1
...
...
.ci/setup.sh
View file @
cc733f85
...
@@ -4,10 +4,10 @@ if [[ $OS_NAME == "macos" ]]; then
...
@@ -4,10 +4,10 @@ if [[ $OS_NAME == "macos" ]]; then
if
[[
$COMPILER
==
"clang"
]]
;
then
if
[[
$COMPILER
==
"clang"
]]
;
then
brew
install
libomp
brew
install
libomp
if
[[
$AZURE
==
"true"
]]
;
then
if
[[
$AZURE
==
"true"
]]
;
then
sudo
xcode-select
-s
/Applications/Xcode_11.7.app/Contents/Developer
||
exit
-
1
sudo
xcode-select
-s
/Applications/Xcode_11.7.app/Contents/Developer
||
exit
1
fi
fi
else
# gcc
else
# gcc
sudo
xcode-select
-s
/Applications/Xcode_14.1.app/Contents/Developer
||
exit
-
1
sudo
xcode-select
-s
/Applications/Xcode_14.1.app/Contents/Developer
||
exit
1
if
[[
$TASK
!=
"mpi"
]]
;
then
if
[[
$TASK
!=
"mpi"
]]
;
then
brew
install
gcc
brew
install
gcc
fi
fi
...
@@ -49,7 +49,7 @@ else # Linux
...
@@ -49,7 +49,7 @@ else # Linux
locales-all
\
locales-all
\
netcat
\
netcat
\
unzip
\
unzip
\
zip
||
exit
-
1
zip
||
exit
1
if
[[
$COMPILER
==
"clang"
]]
;
then
if
[[
$COMPILER
==
"clang"
]]
;
then
sudo
apt-get
install
--no-install-recommends
-y
\
sudo
apt-get
install
--no-install-recommends
-y
\
clang
\
clang
\
...
@@ -82,7 +82,7 @@ else # Linux
...
@@ -82,7 +82,7 @@ else # Linux
sudo
yum update
-y
sudo
yum update
-y
sudo
yum
install
-y
\
sudo
yum
install
-y
\
openmpi-devel
\
openmpi-devel
\
||
exit
-
1
||
exit
1
fi
fi
fi
fi
if
[[
$TASK
==
"gpu"
]]
;
then
if
[[
$TASK
==
"gpu"
]]
;
then
...
@@ -98,7 +98,7 @@ else # Linux
...
@@ -98,7 +98,7 @@ else # Linux
boost-devel
\
boost-devel
\
ocl-icd-devel
\
ocl-icd-devel
\
opencl-headers
\
opencl-headers
\
||
exit
-
1
||
exit
1
fi
fi
fi
fi
if
[[
$TASK
==
"gpu"
||
$TASK
==
"bdist"
]]
;
then
if
[[
$TASK
==
"gpu"
||
$TASK
==
"bdist"
]]
;
then
...
@@ -111,7 +111,7 @@ else # Linux
...
@@ -111,7 +111,7 @@ else # Linux
sudo
yum
install
-y
\
sudo
yum
install
-y
\
ocl-icd-devel
\
ocl-icd-devel
\
opencl-headers
\
opencl-headers
\
||
exit
-
1
||
exit
1
fi
fi
fi
fi
if
[[
$TASK
==
"cuda"
]]
;
then
if
[[
$TASK
==
"cuda"
]]
;
then
...
...
.ci/test-python-oldest.sh
View file @
cc733f85
...
@@ -14,11 +14,11 @@ pip install \
...
@@ -14,11 +14,11 @@ pip install \
'pyarrow==6.0.1'
\
'pyarrow==6.0.1'
\
'scikit-learn==0.18.2'
\
'scikit-learn==0.18.2'
\
'scipy==0.19.0'
\
'scipy==0.19.0'
\
||
exit
-
1
||
exit
1
echo
"done installing lightgbm's dependencies"
echo
"done installing lightgbm's dependencies"
echo
"installing lightgbm"
echo
"installing lightgbm"
pip
install
--no-deps
dist/
*
.whl
||
exit
-
1
pip
install
--no-deps
dist/
*
.whl
||
exit
1
echo
"done installing lightgbm"
echo
"done installing lightgbm"
echo
"installed package versions:"
echo
"installed package versions:"
...
@@ -31,22 +31,22 @@ echo "checking that examples run without error"
...
@@ -31,22 +31,22 @@ echo "checking that examples run without error"
echo
""
echo
""
echo
"--- advanced_example.py ---"
echo
"--- advanced_example.py ---"
echo
""
echo
""
python ./examples/python-guide/advanced_example.py
||
exit
-
1
python ./examples/python-guide/advanced_example.py
||
exit
1
echo
""
echo
""
echo
"--- logistic_regression.py ---"
echo
"--- logistic_regression.py ---"
echo
""
echo
""
python ./examples/python-guide/logistic_regression.py
||
exit
-
1
python ./examples/python-guide/logistic_regression.py
||
exit
1
echo
""
echo
""
echo
"--- simple_example.py ---"
echo
"--- simple_example.py ---"
echo
""
echo
""
python ./examples/python-guide/simple_example.py
||
exit
-
1
python ./examples/python-guide/simple_example.py
||
exit
1
echo
""
echo
""
echo
"--- sklearn_example.py ---"
echo
"--- sklearn_example.py ---"
echo
""
echo
""
python ./examples/python-guide/sklearn_example.py
||
exit
-
1
python ./examples/python-guide/sklearn_example.py
||
exit
1
echo
""
echo
""
echo
"done testing on oldest supported Python version"
echo
"done testing on oldest supported Python version"
.ci/test.sh
View file @
cc733f85
...
@@ -17,7 +17,7 @@ if [[ $IN_UBUNTU_BASE_CONTAINER == "true" ]]; then
...
@@ -17,7 +17,7 @@ if [[ $IN_UBUNTU_BASE_CONTAINER == "true" ]]; then
fi
fi
if
[[
"
${
TASK
}
"
==
"r-package"
]]
||
[[
"
${
TASK
}
"
==
"r-rchk"
]]
;
then
if
[[
"
${
TASK
}
"
==
"r-package"
]]
||
[[
"
${
TASK
}
"
==
"r-rchk"
]]
;
then
bash
${
BUILD_DIRECTORY
}
/.ci/test_r_package.sh
||
exit
-
1
bash
${
BUILD_DIRECTORY
}
/.ci/test_r_package.sh
||
exit
1
exit
0
exit
0
fi
fi
...
@@ -32,8 +32,8 @@ if [[ "$TASK" == "cpp-tests" ]]; then
...
@@ -32,8 +32,8 @@ if [[ "$TASK" == "cpp-tests" ]]; then
extra_cmake_opts
=
""
extra_cmake_opts
=
""
fi
fi
cmake
-DBUILD_CPP_TEST
=
ON
-DUSE_OPENMP
=
OFF
-DUSE_DEBUG
=
ON
$extra_cmake_opts
..
cmake
-DBUILD_CPP_TEST
=
ON
-DUSE_OPENMP
=
OFF
-DUSE_DEBUG
=
ON
$extra_cmake_opts
..
make testlightgbm
-j4
||
exit
-
1
make testlightgbm
-j4
||
exit
1
./../testlightgbm
||
exit
-
1
./../testlightgbm
||
exit
1
exit
0
exit
0
fi
fi
...
@@ -42,10 +42,10 @@ CONDA_PYTHON_REQUIREMENT="python=$PYTHON_VERSION[build=*cpython]"
...
@@ -42,10 +42,10 @@ CONDA_PYTHON_REQUIREMENT="python=$PYTHON_VERSION[build=*cpython]"
if
[[
$TASK
==
"if-else"
]]
;
then
if
[[
$TASK
==
"if-else"
]]
;
then
mamba create
-q
-y
-n
$CONDA_ENV
${
CONDA_PYTHON_REQUIREMENT
}
numpy
mamba create
-q
-y
-n
$CONDA_ENV
${
CONDA_PYTHON_REQUIREMENT
}
numpy
source
activate
$CONDA_ENV
source
activate
$CONDA_ENV
mkdir
$BUILD_DIRECTORY
/build
&&
cd
$BUILD_DIRECTORY
/build
&&
cmake ..
&&
make lightgbm
-j4
||
exit
-
1
mkdir
$BUILD_DIRECTORY
/build
&&
cd
$BUILD_DIRECTORY
/build
&&
cmake ..
&&
make lightgbm
-j4
||
exit
1
cd
$BUILD_DIRECTORY
/tests/cpp_tests
&&
../../lightgbm
config
=
train.conf
convert_model_language
=
cpp
convert_model
=
../../src/boosting/gbdt_prediction.cpp
&&
../../lightgbm
config
=
predict.conf
output_result
=
origin.pred
||
exit
-
1
cd
$BUILD_DIRECTORY
/tests/cpp_tests
&&
../../lightgbm
config
=
train.conf
convert_model_language
=
cpp
convert_model
=
../../src/boosting/gbdt_prediction.cpp
&&
../../lightgbm
config
=
predict.conf
output_result
=
origin.pred
||
exit
1
cd
$BUILD_DIRECTORY
/build
&&
make lightgbm
-j4
||
exit
-
1
cd
$BUILD_DIRECTORY
/build
&&
make lightgbm
-j4
||
exit
1
cd
$BUILD_DIRECTORY
/tests/cpp_tests
&&
../../lightgbm
config
=
predict.conf
output_result
=
ifelse.pred
&&
python test.py
||
exit
-
1
cd
$BUILD_DIRECTORY
/tests/cpp_tests
&&
../../lightgbm
config
=
predict.conf
output_result
=
ifelse.pred
&&
python test.py
||
exit
1
exit
0
exit
0
fi
fi
...
@@ -56,11 +56,11 @@ if [[ $TASK == "swig" ]]; then
...
@@ -56,11 +56,11 @@ if [[ $TASK == "swig" ]]; then
else
else
cmake
-DUSE_SWIG
=
ON ..
cmake
-DUSE_SWIG
=
ON ..
fi
fi
make
-j4
||
exit
-
1
make
-j4
||
exit
1
if
[[
$OS_NAME
==
"linux"
]]
&&
[[
$COMPILER
==
"gcc"
]]
;
then
if
[[
$OS_NAME
==
"linux"
]]
&&
[[
$COMPILER
==
"gcc"
]]
;
then
objdump
-T
$BUILD_DIRECTORY
/lib_lightgbm.so
>
$BUILD_DIRECTORY
/objdump.log
||
exit
-
1
objdump
-T
$BUILD_DIRECTORY
/lib_lightgbm.so
>
$BUILD_DIRECTORY
/objdump.log
||
exit
1
objdump
-T
$BUILD_DIRECTORY
/lib_lightgbm_swig.so
>>
$BUILD_DIRECTORY
/objdump.log
||
exit
-
1
objdump
-T
$BUILD_DIRECTORY
/lib_lightgbm_swig.so
>>
$BUILD_DIRECTORY
/objdump.log
||
exit
1
python
$BUILD_DIRECTORY
/helpers/check_dynamic_dependencies.py
$BUILD_DIRECTORY
/objdump.log
||
exit
-
1
python
$BUILD_DIRECTORY
/helpers/check_dynamic_dependencies.py
$BUILD_DIRECTORY
/objdump.log
||
exit
1
fi
fi
if
[[
$PRODUCES_ARTIFACTS
==
"true"
]]
;
then
if
[[
$PRODUCES_ARTIFACTS
==
"true"
]]
;
then
cp
$BUILD_DIRECTORY
/build/lightgbmlib.jar
$BUILD_ARTIFACTSTAGINGDIRECTORY
/lightgbmlib_
$OS_NAME
.jar
cp
$BUILD_DIRECTORY
/build/lightgbmlib.jar
$BUILD_ARTIFACTSTAGINGDIRECTORY
/lightgbmlib_
$OS_NAME
.jar
...
@@ -80,11 +80,11 @@ if [[ $TASK == "lint" ]]; then
...
@@ -80,11 +80,11 @@ if [[ $TASK == "lint" ]]; then
ruff
ruff
source
activate
$CONDA_ENV
source
activate
$CONDA_ENV
echo
"Linting Python code"
echo
"Linting Python code"
sh
${
BUILD_DIRECTORY
}
/.ci/lint-python.sh
||
exit
-
1
sh
${
BUILD_DIRECTORY
}
/.ci/lint-python.sh
||
exit
1
echo
"Linting R code"
echo
"Linting R code"
Rscript
${
BUILD_DIRECTORY
}
/.ci/lint_r_code.R
${
BUILD_DIRECTORY
}
||
exit
-
1
Rscript
${
BUILD_DIRECTORY
}
/.ci/lint_r_code.R
${
BUILD_DIRECTORY
}
||
exit
1
echo
"Linting C++ code"
echo
"Linting C++ code"
sh
${
BUILD_DIRECTORY
}
/.ci/lint-cpp.sh
||
exit
-
1
sh
${
BUILD_DIRECTORY
}
/.ci/lint-cpp.sh
||
exit
1
exit
0
exit
0
fi
fi
...
@@ -92,33 +92,33 @@ if [[ $TASK == "check-docs" ]] || [[ $TASK == "check-links" ]]; then
...
@@ -92,33 +92,33 @@ if [[ $TASK == "check-docs" ]] || [[ $TASK == "check-links" ]]; then
cd
$BUILD_DIRECTORY
/docs
cd
$BUILD_DIRECTORY
/docs
mamba
env
create
\
mamba
env
create
\
-n
$CONDA_ENV
\
-n
$CONDA_ENV
\
--file
./env.yml
||
exit
-
1
--file
./env.yml
||
exit
1
mamba
install
\
mamba
install
\
-q
\
-q
\
-y
\
-y
\
-n
$CONDA_ENV
\
-n
$CONDA_ENV
\
doxygen
\
doxygen
\
'rstcheck>=6.0.0'
||
exit
-
1
'rstcheck>=6.0.0'
||
exit
1
source
activate
$CONDA_ENV
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
cd
$BUILD_DIRECTORY
/docs
cd
$BUILD_DIRECTORY
/docs
rstcheck
--report-level
warning
--ignore-directives
=
autoclass,autofunction,autosummary,doxygenfile
$(
find
.
-type
f
-name
"*.rst"
)
||
exit
-
1
rstcheck
--report-level
warning
--ignore-directives
=
autoclass,autofunction,autosummary,doxygenfile
$(
find
.
-type
f
-name
"*.rst"
)
||
exit
1
# build docs
# build docs
make html
||
exit
-
1
make html
||
exit
1
if
[[
$TASK
==
"check-links"
]]
;
then
if
[[
$TASK
==
"check-links"
]]
;
then
# check docs for broken links
# check docs for broken links
pip
install
--user
linkchecker
pip
install
--user
linkchecker
linkchecker
--config
=
.linkcheckerrc ./_build/html/
*
.html
||
exit
-
1
linkchecker
--config
=
.linkcheckerrc ./_build/html/
*
.html
||
exit
1
exit
0
exit
0
fi
fi
# check the consistency of parameters' descriptions and other stuff
# check the consistency of parameters' descriptions and other stuff
cp
$BUILD_DIRECTORY
/docs/Parameters.rst
$BUILD_DIRECTORY
/docs/Parameters-backup.rst
cp
$BUILD_DIRECTORY
/docs/Parameters.rst
$BUILD_DIRECTORY
/docs/Parameters-backup.rst
cp
$BUILD_DIRECTORY
/src/io/config_auto.cpp
$BUILD_DIRECTORY
/src/io/config_auto-backup.cpp
cp
$BUILD_DIRECTORY
/src/io/config_auto.cpp
$BUILD_DIRECTORY
/src/io/config_auto-backup.cpp
python
$BUILD_DIRECTORY
/helpers/parameter_generator.py
||
exit
-
1
python
$BUILD_DIRECTORY
/helpers/parameter_generator.py
||
exit
1
diff
$BUILD_DIRECTORY
/docs/Parameters-backup.rst
$BUILD_DIRECTORY
/docs/Parameters.rst
||
exit
-
1
diff
$BUILD_DIRECTORY
/docs/Parameters-backup.rst
$BUILD_DIRECTORY
/docs/Parameters.rst
||
exit
1
diff
$BUILD_DIRECTORY
/src/io/config_auto-backup.cpp
$BUILD_DIRECTORY
/src/io/config_auto.cpp
||
exit
-
1
diff
$BUILD_DIRECTORY
/src/io/config_auto-backup.cpp
$BUILD_DIRECTORY
/src/io/config_auto.cpp
||
exit
1
exit
0
exit
0
fi
fi
...
@@ -144,7 +144,7 @@ mamba create -q -y -n $CONDA_ENV \
...
@@ -144,7 +144,7 @@ mamba create -q -y -n $CONDA_ENV \
${
CONDA_PYTHON_REQUIREMENT
}
\
${
CONDA_PYTHON_REQUIREMENT
}
\
python-graphviz
\
python-graphviz
\
scikit-learn
\
scikit-learn
\
scipy
||
exit
-
1
scipy
||
exit
1
source
activate
$CONDA_ENV
source
activate
$CONDA_ENV
...
@@ -152,30 +152,30 @@ cd $BUILD_DIRECTORY
...
@@ -152,30 +152,30 @@ 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
fi
fi
if
[[
$TASK
==
"sdist"
]]
;
then
if
[[
$TASK
==
"sdist"
]]
;
then
cd
$BUILD_DIRECTORY
&&
sh ./build-python.sh sdist
||
exit
-
1
cd
$BUILD_DIRECTORY
&&
sh ./build-python.sh sdist
||
exit
1
sh
$BUILD_DIRECTORY
/.ci/check_python_dists.sh
$BUILD_DIRECTORY
/dist
||
exit
-
1
sh
$BUILD_DIRECTORY
/.ci/check_python_dists.sh
$BUILD_DIRECTORY
/dist
||
exit
1
pip
install
--user
$BUILD_DIRECTORY
/dist/lightgbm-
$LGB_VER
.tar.gz
-v
||
exit
-
1
pip
install
--user
$BUILD_DIRECTORY
/dist/lightgbm-
$LGB_VER
.tar.gz
-v
||
exit
1
if
[[
$PRODUCES_ARTIFACTS
==
"true"
]]
;
then
if
[[
$PRODUCES_ARTIFACTS
==
"true"
]]
;
then
cp
$BUILD_DIRECTORY
/dist/lightgbm-
$LGB_VER
.tar.gz
$BUILD_ARTIFACTSTAGINGDIRECTORY
||
exit
-
1
cp
$BUILD_DIRECTORY
/dist/lightgbm-
$LGB_VER
.tar.gz
$BUILD_ARTIFACTSTAGINGDIRECTORY
||
exit
1
fi
fi
pytest
$BUILD_DIRECTORY
/tests/python_package_test
||
exit
-
1
pytest
$BUILD_DIRECTORY
/tests/python_package_test
||
exit
1
exit
0
exit
0
elif
[[
$TASK
==
"bdist"
]]
;
then
elif
[[
$TASK
==
"bdist"
]]
;
then
if
[[
$OS_NAME
==
"macos"
]]
;
then
if
[[
$OS_NAME
==
"macos"
]]
;
then
cd
$BUILD_DIRECTORY
&&
sh ./build-python.sh bdist_wheel
||
exit
-
1
cd
$BUILD_DIRECTORY
&&
sh ./build-python.sh bdist_wheel
||
exit
1
sh
$BUILD_DIRECTORY
/.ci/check_python_dists.sh
$BUILD_DIRECTORY
/dist
||
exit
-
1
sh
$BUILD_DIRECTORY
/.ci/check_python_dists.sh
$BUILD_DIRECTORY
/dist
||
exit
1
mv
\
mv
\
./dist/
*
.whl
\
./dist/
*
.whl
\
./dist/tmp.whl
||
exit
-
1
./dist/tmp.whl
||
exit
1
mv
\
mv
\
./dist/tmp.whl
\
./dist/tmp.whl
\
dist/lightgbm-
$LGB_VER
-py3-none-macosx_10_15_x86_64
.macosx_11_6_x86_64.macosx_12_5_x86_64.whl
||
exit
-
1
dist/lightgbm-
$LGB_VER
-py3-none-macosx_10_15_x86_64
.macosx_11_6_x86_64.macosx_12_5_x86_64.whl
||
exit
1
if
[[
$PRODUCES_ARTIFACTS
==
"true"
]]
;
then
if
[[
$PRODUCES_ARTIFACTS
==
"true"
]]
;
then
cp
dist/lightgbm-
$LGB_VER
-py3-none-macosx
*
.whl
$BUILD_ARTIFACTSTAGINGDIRECTORY
||
exit
-
1
cp
dist/lightgbm-
$LGB_VER
-py3-none-macosx
*
.whl
$BUILD_ARTIFACTSTAGINGDIRECTORY
||
exit
1
fi
fi
else
else
ARCH
=
$(
uname
-m
)
ARCH
=
$(
uname
-m
)
...
@@ -184,44 +184,44 @@ elif [[ $TASK == "bdist" ]]; then
...
@@ -184,44 +184,44 @@ elif [[ $TASK == "bdist" ]]; then
else
else
PLATFORM
=
"manylinux2014_
$ARCH
"
PLATFORM
=
"manylinux2014_
$ARCH
"
fi
fi
cd
$BUILD_DIRECTORY
&&
sh ./build-python.sh bdist_wheel
--integrated-opencl
||
exit
-
1
cd
$BUILD_DIRECTORY
&&
sh ./build-python.sh bdist_wheel
--integrated-opencl
||
exit
1
mv
\
mv
\
./dist/
*
.whl
\
./dist/
*
.whl
\
./dist/tmp.whl
||
exit
-
1
./dist/tmp.whl
||
exit
1
mv
\
mv
\
./dist/tmp.whl
\
./dist/tmp.whl
\
./dist/lightgbm-
$LGB_VER
-py3-none-
$PLATFORM
.whl
||
exit
-
1
./dist/lightgbm-
$LGB_VER
-py3-none-
$PLATFORM
.whl
||
exit
1
sh
$BUILD_DIRECTORY
/.ci/check_python_dists.sh
$BUILD_DIRECTORY
/dist
||
exit
-
1
sh
$BUILD_DIRECTORY
/.ci/check_python_dists.sh
$BUILD_DIRECTORY
/dist
||
exit
1
if
[[
$PRODUCES_ARTIFACTS
==
"true"
]]
;
then
if
[[
$PRODUCES_ARTIFACTS
==
"true"
]]
;
then
cp
dist/lightgbm-
$LGB_VER
-py3-none-
$PLATFORM
.whl
$BUILD_ARTIFACTSTAGINGDIRECTORY
||
exit
-
1
cp
dist/lightgbm-
$LGB_VER
-py3-none-
$PLATFORM
.whl
$BUILD_ARTIFACTSTAGINGDIRECTORY
||
exit
1
fi
fi
# Make sure we can do both CPU and GPU; see tests/python_package_test/test_dual.py
# Make sure we can do both CPU and GPU; see tests/python_package_test/test_dual.py
export
LIGHTGBM_TEST_DUAL_CPU_GPU
=
1
export
LIGHTGBM_TEST_DUAL_CPU_GPU
=
1
fi
fi
pip
install
--user
$BUILD_DIRECTORY
/dist/
*
.whl
||
exit
-
1
pip
install
--user
$BUILD_DIRECTORY
/dist/
*
.whl
||
exit
1
pytest
$BUILD_DIRECTORY
/tests
||
exit
-
1
pytest
$BUILD_DIRECTORY
/tests
||
exit
1
exit
0
exit
0
fi
fi
if
[[
$TASK
==
"gpu"
]]
;
then
if
[[
$TASK
==
"gpu"
]]
;
then
sed
-i
'.bak'
's/std::string device_type = "cpu";/std::string device_type = "gpu";/'
$BUILD_DIRECTORY
/include/LightGBM/config.h
sed
-i
'.bak'
's/std::string device_type = "cpu";/std::string device_type = "gpu";/'
$BUILD_DIRECTORY
/include/LightGBM/config.h
grep
-q
'std::string device_type = "gpu"'
$BUILD_DIRECTORY
/include/LightGBM/config.h
||
exit
-
1
# make sure that changes were really done
grep
-q
'std::string device_type = "gpu"'
$BUILD_DIRECTORY
/include/LightGBM/config.h
||
exit
1
# make sure that changes were really done
if
[[
$METHOD
==
"pip"
]]
;
then
if
[[
$METHOD
==
"pip"
]]
;
then
cd
$BUILD_DIRECTORY
&&
sh ./build-python.sh sdist
||
exit
-
1
cd
$BUILD_DIRECTORY
&&
sh ./build-python.sh sdist
||
exit
1
sh
$BUILD_DIRECTORY
/.ci/check_python_dists.sh
$BUILD_DIRECTORY
/dist
||
exit
-
1
sh
$BUILD_DIRECTORY
/.ci/check_python_dists.sh
$BUILD_DIRECTORY
/dist
||
exit
1
pip
install
\
pip
install
\
--user
\
--user
\
-v
\
-v
\
--config-settings
=
cmake.define.USE_GPU
=
ON
\
--config-settings
=
cmake.define.USE_GPU
=
ON
\
$BUILD_DIRECTORY
/dist/lightgbm-
$LGB_VER
.tar.gz
\
$BUILD_DIRECTORY
/dist/lightgbm-
$LGB_VER
.tar.gz
\
||
exit
-
1
||
exit
1
pytest
$BUILD_DIRECTORY
/tests/python_package_test
||
exit
-
1
pytest
$BUILD_DIRECTORY
/tests/python_package_test
||
exit
1
exit
0
exit
0
elif
[[
$METHOD
==
"wheel"
]]
;
then
elif
[[
$METHOD
==
"wheel"
]]
;
then
cd
$BUILD_DIRECTORY
&&
sh ./build-python.sh bdist_wheel
--gpu
||
exit
-
1
cd
$BUILD_DIRECTORY
&&
sh ./build-python.sh bdist_wheel
--gpu
||
exit
1
sh
$BUILD_DIRECTORY
/.ci/check_python_dists.sh
$BUILD_DIRECTORY
/dist
||
exit
-
1
sh
$BUILD_DIRECTORY
/.ci/check_python_dists.sh
$BUILD_DIRECTORY
/dist
||
exit
1
pip
install
--user
$BUILD_DIRECTORY
/dist/lightgbm-
$LGB_VER
*
.whl
-v
||
exit
-
1
pip
install
--user
$BUILD_DIRECTORY
/dist/lightgbm-
$LGB_VER
*
.whl
-v
||
exit
1
pytest
$BUILD_DIRECTORY
/tests
||
exit
-
1
pytest
$BUILD_DIRECTORY
/tests
||
exit
1
exit
0
exit
0
elif
[[
$METHOD
==
"source"
]]
;
then
elif
[[
$METHOD
==
"source"
]]
;
then
mkdir
$BUILD_DIRECTORY
/build
mkdir
$BUILD_DIRECTORY
/build
...
@@ -230,26 +230,26 @@ if [[ $TASK == "gpu" ]]; then
...
@@ -230,26 +230,26 @@ if [[ $TASK == "gpu" ]]; then
fi
fi
elif
[[
$TASK
==
"cuda"
]]
;
then
elif
[[
$TASK
==
"cuda"
]]
;
then
sed
-i
'.bak'
's/std::string device_type = "cpu";/std::string device_type = "cuda";/'
$BUILD_DIRECTORY
/include/LightGBM/config.h
sed
-i
'.bak'
's/std::string device_type = "cpu";/std::string device_type = "cuda";/'
$BUILD_DIRECTORY
/include/LightGBM/config.h
grep
-q
'std::string device_type = "cuda"'
$BUILD_DIRECTORY
/include/LightGBM/config.h
||
exit
-
1
# make sure that changes were really done
grep
-q
'std::string device_type = "cuda"'
$BUILD_DIRECTORY
/include/LightGBM/config.h
||
exit
1
# make sure that changes were really done
# by default ``gpu_use_dp=false`` for efficiency. change to ``true`` here for exact results in ci tests
# by default ``gpu_use_dp=false`` for efficiency. change to ``true`` here for exact results in ci tests
sed
-i
'.bak'
's/gpu_use_dp = false;/gpu_use_dp = true;/'
$BUILD_DIRECTORY
/include/LightGBM/config.h
sed
-i
'.bak'
's/gpu_use_dp = false;/gpu_use_dp = true;/'
$BUILD_DIRECTORY
/include/LightGBM/config.h
grep
-q
'gpu_use_dp = true'
$BUILD_DIRECTORY
/include/LightGBM/config.h
||
exit
-
1
# make sure that changes were really done
grep
-q
'gpu_use_dp = true'
$BUILD_DIRECTORY
/include/LightGBM/config.h
||
exit
1
# make sure that changes were really done
if
[[
$METHOD
==
"pip"
]]
;
then
if
[[
$METHOD
==
"pip"
]]
;
then
cd
$BUILD_DIRECTORY
&&
sh ./build-python.sh sdist
||
exit
-
1
cd
$BUILD_DIRECTORY
&&
sh ./build-python.sh sdist
||
exit
1
sh
$BUILD_DIRECTORY
/.ci/check_python_dists.sh
$BUILD_DIRECTORY
/dist
||
exit
-
1
sh
$BUILD_DIRECTORY
/.ci/check_python_dists.sh
$BUILD_DIRECTORY
/dist
||
exit
1
pip
install
\
pip
install
\
--user
\
--user
\
-v
\
-v
\
--config-settings
=
cmake.define.USE_CUDA
=
ON
\
--config-settings
=
cmake.define.USE_CUDA
=
ON
\
$BUILD_DIRECTORY
/dist/lightgbm-
$LGB_VER
.tar.gz
\
$BUILD_DIRECTORY
/dist/lightgbm-
$LGB_VER
.tar.gz
\
||
exit
-
1
||
exit
1
pytest
$BUILD_DIRECTORY
/tests/python_package_test
||
exit
-
1
pytest
$BUILD_DIRECTORY
/tests/python_package_test
||
exit
1
exit
0
exit
0
elif
[[
$METHOD
==
"wheel"
]]
;
then
elif
[[
$METHOD
==
"wheel"
]]
;
then
cd
$BUILD_DIRECTORY
&&
sh ./build-python.sh bdist_wheel
--cuda
||
exit
-
1
cd
$BUILD_DIRECTORY
&&
sh ./build-python.sh bdist_wheel
--cuda
||
exit
1
sh
$BUILD_DIRECTORY
/.ci/check_python_dists.sh
$BUILD_DIRECTORY
/dist
||
exit
-
1
sh
$BUILD_DIRECTORY
/.ci/check_python_dists.sh
$BUILD_DIRECTORY
/dist
||
exit
1
pip
install
--user
$BUILD_DIRECTORY
/dist/lightgbm-
$LGB_VER
*
.whl
-v
||
exit
-
1
pip
install
--user
$BUILD_DIRECTORY
/dist/lightgbm-
$LGB_VER
*
.whl
-v
||
exit
1
pytest
$BUILD_DIRECTORY
/tests
||
exit
-
1
pytest
$BUILD_DIRECTORY
/tests
||
exit
1
exit
0
exit
0
elif
[[
$METHOD
==
"source"
]]
;
then
elif
[[
$METHOD
==
"source"
]]
;
then
mkdir
$BUILD_DIRECTORY
/build
mkdir
$BUILD_DIRECTORY
/build
...
@@ -258,21 +258,21 @@ elif [[ $TASK == "cuda" ]]; then
...
@@ -258,21 +258,21 @@ elif [[ $TASK == "cuda" ]]; then
fi
fi
elif
[[
$TASK
==
"mpi"
]]
;
then
elif
[[
$TASK
==
"mpi"
]]
;
then
if
[[
$METHOD
==
"pip"
]]
;
then
if
[[
$METHOD
==
"pip"
]]
;
then
cd
$BUILD_DIRECTORY
&&
sh ./build-python.sh sdist
||
exit
-
1
cd
$BUILD_DIRECTORY
&&
sh ./build-python.sh sdist
||
exit
1
sh
$BUILD_DIRECTORY
/.ci/check_python_dists.sh
$BUILD_DIRECTORY
/dist
||
exit
-
1
sh
$BUILD_DIRECTORY
/.ci/check_python_dists.sh
$BUILD_DIRECTORY
/dist
||
exit
1
pip
install
\
pip
install
\
--user
\
--user
\
-v
\
-v
\
--config-settings
=
cmake.define.USE_MPI
=
ON
\
--config-settings
=
cmake.define.USE_MPI
=
ON
\
$BUILD_DIRECTORY
/dist/lightgbm-
$LGB_VER
.tar.gz
\
$BUILD_DIRECTORY
/dist/lightgbm-
$LGB_VER
.tar.gz
\
||
exit
-
1
||
exit
1
pytest
$BUILD_DIRECTORY
/tests/python_package_test
||
exit
-
1
pytest
$BUILD_DIRECTORY
/tests/python_package_test
||
exit
1
exit
0
exit
0
elif
[[
$METHOD
==
"wheel"
]]
;
then
elif
[[
$METHOD
==
"wheel"
]]
;
then
cd
$BUILD_DIRECTORY
&&
sh ./build-python.sh bdist_wheel
--mpi
||
exit
-
1
cd
$BUILD_DIRECTORY
&&
sh ./build-python.sh bdist_wheel
--mpi
||
exit
1
sh
$BUILD_DIRECTORY
/.ci/check_python_dists.sh
$BUILD_DIRECTORY
/dist
||
exit
-
1
sh
$BUILD_DIRECTORY
/.ci/check_python_dists.sh
$BUILD_DIRECTORY
/dist
||
exit
1
pip
install
--user
$BUILD_DIRECTORY
/dist/lightgbm-
$LGB_VER
*
.whl
-v
||
exit
-
1
pip
install
--user
$BUILD_DIRECTORY
/dist/lightgbm-
$LGB_VER
*
.whl
-v
||
exit
1
pytest
$BUILD_DIRECTORY
/tests
||
exit
-
1
pytest
$BUILD_DIRECTORY
/tests
||
exit
1
exit
0
exit
0
elif
[[
$METHOD
==
"source"
]]
;
then
elif
[[
$METHOD
==
"source"
]]
;
then
mkdir
$BUILD_DIRECTORY
/build
mkdir
$BUILD_DIRECTORY
/build
...
@@ -285,10 +285,10 @@ else
...
@@ -285,10 +285,10 @@ else
cmake ..
cmake ..
fi
fi
make _lightgbm
-j4
||
exit
-
1
make _lightgbm
-j4
||
exit
1
cd
$BUILD_DIRECTORY
&&
sh ./build-python.sh
install
--precompile
--user
||
exit
-
1
cd
$BUILD_DIRECTORY
&&
sh ./build-python.sh
install
--precompile
--user
||
exit
1
pytest
$BUILD_DIRECTORY
/tests
||
exit
-
1
pytest
$BUILD_DIRECTORY
/tests
||
exit
1
if
[[
$TASK
==
"regular"
]]
;
then
if
[[
$TASK
==
"regular"
]]
;
then
if
[[
$PRODUCES_ARTIFACTS
==
"true"
]]
;
then
if
[[
$PRODUCES_ARTIFACTS
==
"true"
]]
;
then
...
@@ -296,8 +296,8 @@ if [[ $TASK == "regular" ]]; then
...
@@ -296,8 +296,8 @@ if [[ $TASK == "regular" ]]; then
cp
$BUILD_DIRECTORY
/lib_lightgbm.so
$BUILD_ARTIFACTSTAGINGDIRECTORY
/lib_lightgbm.dylib
cp
$BUILD_DIRECTORY
/lib_lightgbm.so
$BUILD_ARTIFACTSTAGINGDIRECTORY
/lib_lightgbm.dylib
else
else
if
[[
$COMPILER
==
"gcc"
]]
;
then
if
[[
$COMPILER
==
"gcc"
]]
;
then
objdump
-T
$BUILD_DIRECTORY
/lib_lightgbm.so
>
$BUILD_DIRECTORY
/objdump.log
||
exit
-
1
objdump
-T
$BUILD_DIRECTORY
/lib_lightgbm.so
>
$BUILD_DIRECTORY
/objdump.log
||
exit
1
python
$BUILD_DIRECTORY
/helpers/check_dynamic_dependencies.py
$BUILD_DIRECTORY
/objdump.log
||
exit
-
1
python
$BUILD_DIRECTORY
/helpers/check_dynamic_dependencies.py
$BUILD_DIRECTORY
/objdump.log
||
exit
1
fi
fi
cp
$BUILD_DIRECTORY
/lib_lightgbm.so
$BUILD_ARTIFACTSTAGINGDIRECTORY
/lib_lightgbm.so
cp
$BUILD_DIRECTORY
/lib_lightgbm.so
$BUILD_ARTIFACTSTAGINGDIRECTORY
/lib_lightgbm.so
fi
fi
...
@@ -313,10 +313,10 @@ matplotlib.use\(\"Agg\"\)\
...
@@ -313,10 +313,10 @@ matplotlib.use\(\"Agg\"\)\
h5py
\
h5py
\
ipywidgets
\
ipywidgets
\
notebook
notebook
for
f
in
*
.py
**
/
*
.py
;
do
python
$f
||
exit
-
1
;
done
# run all examples
for
f
in
*
.py
**
/
*
.py
;
do
python
$f
||
exit
1
;
done
# run all examples
cd
$BUILD_DIRECTORY
/examples/python-guide/notebooks
cd
$BUILD_DIRECTORY
/examples/python-guide/notebooks
sed
-i
'.bak'
's/INTERACTIVE = False/assert False, \\"Interactive mode disabled\\"/'
interactive_plot_example.ipynb
sed
-i
'.bak'
's/INTERACTIVE = False/assert False, \\"Interactive mode disabled\\"/'
interactive_plot_example.ipynb
jupyter nbconvert
--ExecutePreprocessor
.timeout
=
180
--to
notebook
--execute
--inplace
*
.ipynb
||
exit
-
1
# run all notebooks
jupyter nbconvert
--ExecutePreprocessor
.timeout
=
180
--to
notebook
--execute
--inplace
*
.ipynb
||
exit
1
# run all notebooks
# importing the library should succeed even if all optional dependencies are not present
# importing the library should succeed even if all optional dependencies are not present
conda uninstall
-n
$CONDA_ENV
--force
--yes
\
conda uninstall
-n
$CONDA_ENV
--force
--yes
\
...
@@ -328,6 +328,6 @@ matplotlib.use\(\"Agg\"\)\
...
@@ -328,6 +328,6 @@ matplotlib.use\(\"Agg\"\)\
psutil
\
psutil
\
pyarrow
\
pyarrow
\
python-graphviz
\
python-graphviz
\
scikit-learn
||
exit
-
1
scikit-learn
||
exit
1
python
-c
"import lightgbm"
||
exit
-
1
python
-c
"import lightgbm"
||
exit
1
fi
fi
.ci/test_r_package.sh
View file @
cc733f85
...
@@ -27,7 +27,7 @@ elif [[ "${R_MAJOR_VERSION}" == "4" ]]; then
...
@@ -27,7 +27,7 @@ elif [[ "${R_MAJOR_VERSION}" == "4" ]]; then
export
R_APT_REPO
=
"jammy-cran40/"
export
R_APT_REPO
=
"jammy-cran40/"
else
else
echo
"Unrecognized R version:
${
R_VERSION
}
"
echo
"Unrecognized R version:
${
R_VERSION
}
"
exit
-
1
exit
1
fi
fi
# installing precompiled R for Ubuntu
# installing precompiled R for Ubuntu
...
@@ -41,9 +41,9 @@ if [[ $OS_NAME == "linux" ]]; then
...
@@ -41,9 +41,9 @@ if [[ $OS_NAME == "linux" ]]; then
sudo
apt-key adv
\
sudo
apt-key adv
\
--homedir
~/.gnupg
\
--homedir
~/.gnupg
\
--keyserver
keyserver.ubuntu.com
\
--keyserver
keyserver.ubuntu.com
\
--recv-keys
E298A3A825C0D65DFD57CBB651716619E084DAB9
||
exit
-
1
--recv-keys
E298A3A825C0D65DFD57CBB651716619E084DAB9
||
exit
1
sudo
add-apt-repository
\
sudo
add-apt-repository
\
"deb
${
CRAN_MIRROR
}
/bin/linux/ubuntu
${
R_APT_REPO
}
"
||
exit
-
1
"deb
${
CRAN_MIRROR
}
/bin/linux/ubuntu
${
R_APT_REPO
}
"
||
exit
1
sudo
apt-get update
sudo
apt-get update
sudo
apt-get
install
\
sudo
apt-get
install
\
--no-install-recommends
\
--no-install-recommends
\
...
@@ -58,7 +58,7 @@ if [[ $OS_NAME == "linux" ]]; then
...
@@ -58,7 +58,7 @@ if [[ $OS_NAME == "linux" ]]; then
texlive-fonts-extra
\
texlive-fonts-extra
\
tidy
\
tidy
\
qpdf
\
qpdf
\
||
exit
-
1
||
exit
1
if
[[
$R_BUILD_TYPE
==
"cran"
]]
;
then
if
[[
$R_BUILD_TYPE
==
"cran"
]]
;
then
sudo
apt-get
install
\
sudo
apt-get
install
\
...
@@ -66,36 +66,36 @@ if [[ $OS_NAME == "linux" ]]; then
...
@@ -66,36 +66,36 @@ if [[ $OS_NAME == "linux" ]]; then
-y
\
-y
\
autoconf
=
$(
cat
R-package/AUTOCONF_UBUNTU_VERSION
)
\
autoconf
=
$(
cat
R-package/AUTOCONF_UBUNTU_VERSION
)
\
automake
\
automake
\
||
exit
-
1
||
exit
1
fi
fi
if
[[
$INSTALL_CMAKE_FROM_RELEASES
==
"true"
]]
;
then
if
[[
$INSTALL_CMAKE_FROM_RELEASES
==
"true"
]]
;
then
curl
-O
-L
\
curl
-O
-L
\
https://github.com/Kitware/CMake/releases/download/v3.25.1/cmake-3.25.1-linux-x86_64.sh
\
https://github.com/Kitware/CMake/releases/download/v3.25.1/cmake-3.25.1-linux-x86_64.sh
\
||
exit
-
1
||
exit
1
sudo mkdir
/opt/cmake
||
exit
-
1
sudo mkdir
/opt/cmake
||
exit
1
sudo
sh cmake-3.25.1-linux-x86_64.sh
--skip-license
--prefix
=
/opt/cmake
||
exit
-
1
sudo
sh cmake-3.25.1-linux-x86_64.sh
--skip-license
--prefix
=
/opt/cmake
||
exit
1
sudo ln
-s
/opt/cmake/bin/cmake /usr/local/bin/cmake
||
exit
-
1
sudo ln
-s
/opt/cmake/bin/cmake /usr/local/bin/cmake
||
exit
1
fi
fi
fi
fi
# Installing R precompiled for Mac OS 10.11 or higher
# Installing R precompiled for Mac OS 10.11 or higher
if
[[
$OS_NAME
==
"macos"
]]
;
then
if
[[
$OS_NAME
==
"macos"
]]
;
then
if
[[
$R_BUILD_TYPE
==
"cran"
]]
;
then
if
[[
$R_BUILD_TYPE
==
"cran"
]]
;
then
brew
install
automake
||
exit
-
1
brew
install
automake
||
exit
1
fi
fi
brew
install
\
brew
install
\
checkbashisms
\
checkbashisms
\
qpdf
||
exit
-
1
qpdf
||
exit
1
brew
install
basictex
||
exit
-
1
brew
install
basictex
||
exit
1
export
PATH
=
"/Library/TeX/texbin:
$PATH
"
export
PATH
=
"/Library/TeX/texbin:
$PATH
"
sudo
tlmgr
--verify-repo
=
none update
--self
||
exit
-
1
sudo
tlmgr
--verify-repo
=
none update
--self
||
exit
1
sudo
tlmgr
--verify-repo
=
none
install
inconsolata helvetic rsfs
||
exit
-
1
sudo
tlmgr
--verify-repo
=
none
install
inconsolata helvetic rsfs
||
exit
1
curl
-sL
${
R_MAC_PKG_URL
}
-o
R.pkg
||
exit
-
1
curl
-sL
${
R_MAC_PKG_URL
}
-o
R.pkg
||
exit
1
sudo
installer
\
sudo
installer
\
-pkg
$(
pwd
)
/R.pkg
\
-pkg
$(
pwd
)
/R.pkg
\
-target
/
||
exit
-
1
-target
/
||
exit
1
# Older R versions (<= 4.1.2) on newer macOS (>= 11.0.0) cannot create the necessary symlinks.
# Older R versions (<= 4.1.2) on newer macOS (>= 11.0.0) cannot create the necessary symlinks.
# See https://github.com/r-lib/actions/issues/412.
# See https://github.com/r-lib/actions/issues/412.
...
@@ -140,14 +140,14 @@ if [[ $OS_NAME == "macos" ]]; then
...
@@ -140,14 +140,14 @@ if [[ $OS_NAME == "macos" ]]; then
packages+
=
", type = 'binary'"
packages+
=
", type = 'binary'"
compile_from_source
=
"never"
compile_from_source
=
"never"
fi
fi
Rscript
--vanilla
-e
"options(install.packages.compile.from.source = '
${
compile_from_source
}
'); install.packages(
${
packages
}
, repos = '
${
CRAN_MIRROR
}
', lib = '
${
R_LIB_PATH
}
', dependencies = c('Depends', 'Imports', 'LinkingTo'), Ncpus = parallel::detectCores())"
||
exit
-
1
Rscript
--vanilla
-e
"options(install.packages.compile.from.source = '
${
compile_from_source
}
'); install.packages(
${
packages
}
, repos = '
${
CRAN_MIRROR
}
', lib = '
${
R_LIB_PATH
}
', dependencies = c('Depends', 'Imports', 'LinkingTo'), Ncpus = parallel::detectCores())"
||
exit
1
cd
${
BUILD_DIRECTORY
}
cd
${
BUILD_DIRECTORY
}
PKG_TARBALL
=
"lightgbm_*.tar.gz"
PKG_TARBALL
=
"lightgbm_*.tar.gz"
LOG_FILE_NAME
=
"lightgbm.Rcheck/00check.log"
LOG_FILE_NAME
=
"lightgbm.Rcheck/00check.log"
if
[[
$R_BUILD_TYPE
==
"cmake"
]]
;
then
if
[[
$R_BUILD_TYPE
==
"cmake"
]]
;
then
Rscript build_r.R
-j4
--skip-install
||
exit
-
1
Rscript build_r.R
-j4
--skip-install
||
exit
1
elif
[[
$R_BUILD_TYPE
==
"cran"
]]
;
then
elif
[[
$R_BUILD_TYPE
==
"cran"
]]
;
then
# on Linux, we recreate configure in CI to test if
# on Linux, we recreate configure in CI to test if
...
@@ -164,11 +164,11 @@ elif [[ $R_BUILD_TYPE == "cran" ]]; then
...
@@ -164,11 +164,11 @@ elif [[ $R_BUILD_TYPE == "cran" ]]; then
git diff
--compact-summary
git diff
--compact-summary
echo
"See R-package/README.md for details on how to recreate this script."
echo
"See R-package/README.md for details on how to recreate this script."
echo
""
echo
""
exit
-
1
exit
1
fi
fi
fi
fi
./build-cran-package.sh
||
exit
-
1
./build-cran-package.sh
||
exit
1
if
[[
"
${
TASK
}
"
==
"r-rchk"
]]
;
then
if
[[
"
${
TASK
}
"
==
"r-rchk"
]]
;
then
echo
"Checking R package with rchk"
echo
"Checking R package with rchk"
...
@@ -180,7 +180,7 @@ elif [[ $R_BUILD_TYPE == "cran" ]]; then
...
@@ -180,7 +180,7 @@ elif [[ $R_BUILD_TYPE == "cran" ]]; then
kalibera/rchk:latest
\
kalibera/rchk:latest
\
"/rchk/packages/
${
PKG_TARBALL
}
"
\
"/rchk/packages/
${
PKG_TARBALL
}
"
\
2>&1
>
${
RCHK_LOG_FILE
}
\
2>&1
>
${
RCHK_LOG_FILE
}
\
||
(
cat
${
RCHK_LOG_FILE
}
&&
exit
-
1
)
||
(
cat
${
RCHK_LOG_FILE
}
&&
exit
1
)
cat
${
RCHK_LOG_FILE
}
cat
${
RCHK_LOG_FILE
}
# the exceptions below are from R itself and not LightGBM:
# the exceptions below are from R itself and not LightGBM:
...
@@ -228,7 +228,7 @@ BUILD_LOG_FILE=lightgbm.Rcheck/00install.out
...
@@ -228,7 +228,7 @@ BUILD_LOG_FILE=lightgbm.Rcheck/00install.out
cat
${
BUILD_LOG_FILE
}
cat
${
BUILD_LOG_FILE
}
if
[[
$check_succeeded
==
"no"
]]
;
then
if
[[
$check_succeeded
==
"no"
]]
;
then
exit
-
1
exit
1
fi
fi
used_correct_r_version
=
$(
used_correct_r_version
=
$(
...
@@ -237,7 +237,7 @@ used_correct_r_version=$(
...
@@ -237,7 +237,7 @@ used_correct_r_version=$(
)
)
if
[[
$used_correct_r_version
-ne
1
]]
;
then
if
[[
$used_correct_r_version
-ne
1
]]
;
then
echo
"Unexpected R version was used. Expected '
${
R_VERSION
}
'."
echo
"Unexpected R version was used. Expected '
${
R_VERSION
}
'."
exit
-
1
exit
1
fi
fi
if
[[
$R_BUILD_TYPE
==
"cmake"
]]
;
then
if
[[
$R_BUILD_TYPE
==
"cmake"
]]
;
then
...
@@ -247,14 +247,14 @@ if [[ $R_BUILD_TYPE == "cmake" ]]; then
...
@@ -247,14 +247,14 @@ if [[ $R_BUILD_TYPE == "cmake" ]]; then
)
)
if
[[
$used_correct_r_version
-ne
1
]]
;
then
if
[[
$used_correct_r_version
-ne
1
]]
;
then
echo
"Unexpected R version was passed into cmake. Expected '
${
R_VERSION
}
'."
echo
"Unexpected R version was passed into cmake. Expected '
${
R_VERSION
}
'."
exit
-
1
exit
1
fi
fi
fi
fi
if
grep
-q
-E
"NOTE|WARNING|ERROR"
"
$LOG_FILE_NAME
"
;
then
if
grep
-q
-E
"NOTE|WARNING|ERROR"
"
$LOG_FILE_NAME
"
;
then
echo
"NOTEs, WARNINGs, or ERRORs have been found by R CMD check"
echo
"NOTEs, WARNINGs, or ERRORs have been found by R CMD check"
exit
-
1
exit
1
fi
fi
# this check makes sure that CI builds of the package actually use OpenMP
# this check makes sure that CI builds of the package actually use OpenMP
...
@@ -273,7 +273,7 @@ else
...
@@ -273,7 +273,7 @@ else
fi
fi
if
[[
$omp_working
-ne
1
]]
;
then
if
[[
$omp_working
-ne
1
]]
;
then
echo
"OpenMP was not found"
echo
"OpenMP was not found"
exit
-
1
exit
1
fi
fi
# this check makes sure that CI builds of the package
# this check makes sure that CI builds of the package
...
@@ -291,7 +291,7 @@ else
...
@@ -291,7 +291,7 @@ else
fi
fi
if
[[
$mm_prefetch_working
-ne
1
]]
;
then
if
[[
$mm_prefetch_working
-ne
1
]]
;
then
echo
"MM_PREFETCH test was not passed"
echo
"MM_PREFETCH test was not passed"
exit
-
1
exit
1
fi
fi
# this check makes sure that CI builds of the package
# this check makes sure that CI builds of the package
...
@@ -309,7 +309,7 @@ else
...
@@ -309,7 +309,7 @@ else
fi
fi
if
[[
$mm_malloc_working
-ne
1
]]
;
then
if
[[
$mm_malloc_working
-ne
1
]]
;
then
echo
"MM_MALLOC test was not passed"
echo
"MM_MALLOC test was not passed"
exit
-
1
exit
1
fi
fi
# this check makes sure that no "warning: unknown pragma ignored" logs
# this check makes sure that no "warning: unknown pragma ignored" logs
...
@@ -321,6 +321,6 @@ if [[ $R_BUILD_TYPE == "cran" ]]; then
...
@@ -321,6 +321,6 @@ if [[ $R_BUILD_TYPE == "cran" ]]; then
)
)
if
[[
$pragma_warning_present
-ne
0
]]
;
then
if
[[
$pragma_warning_present
-ne
0
]]
;
then
echo
"Unknown pragma warning is present, pragmas should have been removed before build"
echo
"Unknown pragma warning is present, pragmas should have been removed before build"
exit
-
1
exit
1
fi
fi
fi
fi
.ci/test_r_package_valgrind.sh
View file @
cc733f85
#!/bin/bash
#!/bin/bash
RDscriptvalgrind
-e
"install.packages(c('R6', 'data.table', 'jsonlite', 'Matrix', 'RhpcBLASctl', 'testthat'), repos = 'https://cran.rstudio.com')"
||
exit
-
1
RDscriptvalgrind
-e
"install.packages(c('R6', 'data.table', 'jsonlite', 'Matrix', 'RhpcBLASctl', 'testthat'), repos = 'https://cran.rstudio.com')"
||
exit
1
sh build-cran-package.sh
\
sh build-cran-package.sh
\
--r-executable
=
RDvalgrind
\
--r-executable
=
RDvalgrind
\
--no-build-vignettes
\
--no-build-vignettes
\
||
exit
-
1
||
exit
1
RDvalgrind CMD INSTALL
--preclean
--install-tests
lightgbm_
*
.tar.gz
||
exit
-
1
RDvalgrind CMD INSTALL
--preclean
--install-tests
lightgbm_
*
.tar.gz
||
exit
1
cd
R-package/tests
cd
R-package/tests
...
@@ -18,7 +18,7 @@ RDvalgrind \
...
@@ -18,7 +18,7 @@ RDvalgrind \
--vanilla
\
--vanilla
\
-d
"valgrind --tool=memcheck --leak-check=full --track-origins=yes"
\
-d
"valgrind --tool=memcheck --leak-check=full --track-origins=yes"
\
-f
testthat.R
\
-f
testthat.R
\
>
${
ALL_LOGS_FILE
}
2>&1
||
exit
-
1
>
${
ALL_LOGS_FILE
}
2>&1
||
exit
1
cat
${
ALL_LOGS_FILE
}
cat
${
ALL_LOGS_FILE
}
...
@@ -33,7 +33,7 @@ bytes_definitely_lost=$(
...
@@ -33,7 +33,7 @@ bytes_definitely_lost=$(
)
)
echo
"valgrind found
${
bytes_definitely_lost
}
bytes definitely lost"
echo
"valgrind found
${
bytes_definitely_lost
}
bytes definitely lost"
if
[[
${
bytes_definitely_lost
}
-gt
0
]]
;
then
if
[[
${
bytes_definitely_lost
}
-gt
0
]]
;
then
exit
-
1
exit
1
fi
fi
bytes_indirectly_lost
=
$(
bytes_indirectly_lost
=
$(
...
@@ -44,7 +44,7 @@ bytes_indirectly_lost=$(
...
@@ -44,7 +44,7 @@ bytes_indirectly_lost=$(
)
)
echo
"valgrind found
${
bytes_indirectly_lost
}
bytes indirectly lost"
echo
"valgrind found
${
bytes_indirectly_lost
}
bytes indirectly lost"
if
[[
${
bytes_indirectly_lost
}
-gt
0
]]
;
then
if
[[
${
bytes_indirectly_lost
}
-gt
0
]]
;
then
exit
-
1
exit
1
fi
fi
# one error caused by a false positive between valgrind and openmp is allowed
# one error caused by a false positive between valgrind and openmp is allowed
...
@@ -71,7 +71,7 @@ bytes_possibly_lost=$(
...
@@ -71,7 +71,7 @@ bytes_possibly_lost=$(
)
)
echo
"valgrind found
${
bytes_possibly_lost
}
bytes possibly lost"
echo
"valgrind found
${
bytes_possibly_lost
}
bytes possibly lost"
if
[[
${
bytes_possibly_lost
}
-gt
1056
]]
;
then
if
[[
${
bytes_possibly_lost
}
-gt
1056
]]
;
then
exit
-
1
exit
1
fi
fi
invalid_reads
=
$(
invalid_reads
=
$(
...
@@ -80,7 +80,7 @@ invalid_reads=$(
...
@@ -80,7 +80,7 @@ invalid_reads=$(
)
)
if
[[
${
invalid_reads
}
-gt
0
]]
;
then
if
[[
${
invalid_reads
}
-gt
0
]]
;
then
echo
"valgrind found invalid reads:
${
invalid_reads
}
"
echo
"valgrind found invalid reads:
${
invalid_reads
}
"
exit
-
1
exit
1
fi
fi
invalid_writes
=
$(
invalid_writes
=
$(
...
@@ -89,5 +89,5 @@ invalid_writes=$(
...
@@ -89,5 +89,5 @@ invalid_writes=$(
)
)
if
[[
${
invalid_writes
}
-gt
0
]]
;
then
if
[[
${
invalid_writes
}
-gt
0
]]
;
then
echo
"valgrind found invalid writes:
${
invalid_writes
}
"
echo
"valgrind found invalid writes:
${
invalid_writes
}
"
exit
-
1
exit
1
fi
fi
.ci/test_windows.ps1
View file @
cc733f85
...
@@ -2,7 +2,7 @@ function Check-Output {
...
@@ -2,7 +2,7 @@ function Check-Output {
param
(
[
bool
]
$success
)
param
(
[
bool
]
$success
)
if
(
!
$success
)
{
if
(
!
$success
)
{
$host
.
SetShouldExit
(
-1
)
$host
.
SetShouldExit
(
-1
)
E
xit
-
1
e
xit
1
}
}
}
}
...
...
.ci/trigger_dispatch_run.sh
View file @
cc733f85
...
@@ -16,12 +16,12 @@ set -e
...
@@ -16,12 +16,12 @@ set -e
if
[
-z
"
$GITHUB_ACTIONS
"
]
;
then
if
[
-z
"
$GITHUB_ACTIONS
"
]
;
then
echo
"Must be run inside GitHub Actions CI"
echo
"Must be run inside GitHub Actions CI"
exit
-
1
exit
1
fi
fi
if
[
$#
-ne
3
]
;
then
if
[
$#
-ne
3
]
;
then
echo
"Usage:
$0
<PR_URL> <COMMENT_ID> <DISPATCH_NAME>"
echo
"Usage:
$0
<PR_URL> <COMMENT_ID> <DISPATCH_NAME>"
exit
-
1
exit
1
fi
fi
pr_url
=
$1
pr_url
=
$1
...
...
.github/workflows/cuda.yml
View file @
cc733f85
...
@@ -92,8 +92,8 @@ jobs:
...
@@ -92,8 +92,8 @@ jobs:
export CONDA=\$HOME/miniforge
export CONDA=\$HOME/miniforge
export PATH=\$CONDA/bin:\$PATH
export PATH=\$CONDA/bin:\$PATH
nvidia-smi
nvidia-smi
$ROOT_DOCKER_FOLDER/.ci/setup.sh || exit
-
1
$ROOT_DOCKER_FOLDER/.ci/setup.sh || exit 1
$ROOT_DOCKER_FOLDER/.ci/test.sh || exit
-
1
$ROOT_DOCKER_FOLDER/.ci/test.sh || exit 1
EOF
EOF
cuda_version="${{ matrix.cuda_version }}"
cuda_version="${{ matrix.cuda_version }}"
cuda_major=${cuda_version%%.*}
cuda_major=${cuda_version%%.*}
...
...
.github/workflows/linkchecker.yml
View file @
cc733f85
...
@@ -29,5 +29,5 @@ jobs:
...
@@ -29,5 +29,5 @@ jobs:
export BUILD_DIRECTORY="$GITHUB_WORKSPACE"
export BUILD_DIRECTORY="$GITHUB_WORKSPACE"
export CONDA=${HOME}/miniforge
export CONDA=${HOME}/miniforge
export PATH=${CONDA}/bin:${HOME}/.local/bin:${PATH}
export PATH=${CONDA}/bin:${HOME}/.local/bin:${PATH}
$GITHUB_WORKSPACE/.ci/setup.sh || exit
-
1
$GITHUB_WORKSPACE/.ci/setup.sh || exit 1
$GITHUB_WORKSPACE/.ci/test.sh || exit
-
1
$GITHUB_WORKSPACE/.ci/test.sh || exit 1
.github/workflows/optional_checks.yml
View file @
cc733f85
...
@@ -26,5 +26,5 @@ jobs:
...
@@ -26,5 +26,5 @@ jobs:
trigger_phrase=${i#*;}
trigger_phrase=${i#*;}
python "$GITHUB_WORKSPACE/.ci/get_workflow_status.py" "$trigger_phrase" \
python "$GITHUB_WORKSPACE/.ci/get_workflow_status.py" "$trigger_phrase" \
|| { echo "The last reported status from workflow \"$workflow_name\" is failure. Commit fixes and rerun the workflow."; \
|| { echo "The last reported status from workflow \"$workflow_name\" is failure. Commit fixes and rerun the workflow."; \
exit
-
1; }
exit 1; }
done
done
.github/workflows/python_package.yml
View file @
cc733f85
...
@@ -74,8 +74,8 @@ jobs:
...
@@ -74,8 +74,8 @@ jobs:
export LGB_VER=$(head -n 1 VERSION.txt)
export LGB_VER=$(head -n 1 VERSION.txt)
export CONDA=${HOME}/miniforge
export CONDA=${HOME}/miniforge
export PATH=${CONDA}/bin:${PATH}
export PATH=${CONDA}/bin:${PATH}
$GITHUB_WORKSPACE/.ci/setup.sh || exit
-
1
$GITHUB_WORKSPACE/.ci/setup.sh || exit 1
$GITHUB_WORKSPACE/.ci/test.sh || exit
-
1
$GITHUB_WORKSPACE/.ci/test.sh || exit 1
test-oldest-versions
:
test-oldest-versions
:
name
:
Python - oldest supported versions (ubuntu-latest)
name
:
Python - oldest supported versions (ubuntu-latest)
runs-on
:
ubuntu-latest
runs-on
:
ubuntu-latest
...
...
.github/workflows/r_configure.yml
View file @
cc733f85
...
@@ -31,7 +31,7 @@ jobs:
...
@@ -31,7 +31,7 @@ jobs:
persist-credentials
:
true
persist-credentials
:
true
-
name
:
Update configure
-
name
:
Update configure
shell
:
bash
shell
:
bash
run
:
./R-package/recreate-configure.sh || exit
-
1
run
:
./R-package/recreate-configure.sh || exit
1
-
name
:
Push changes
-
name
:
Push changes
run
:
|
run
:
|
git config --global user.name "GitHub Actions Bot"
git config --global user.name "GitHub Actions Bot"
...
...
.github/workflows/r_package.yml
View file @
cc733f85
...
@@ -255,7 +255,7 @@ jobs:
...
@@ -255,7 +255,7 @@ jobs:
run
:
|
run
:
|
RDscript${{ matrix.r_customization }} -e "install.packages(c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'testthat'), repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())"
RDscript${{ matrix.r_customization }} -e "install.packages(c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'testthat'), repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())"
sh build-cran-package.sh --r-executable=RD${{ matrix.r_customization }}
sh build-cran-package.sh --r-executable=RD${{ matrix.r_customization }}
RD${{ matrix.r_customization }} CMD INSTALL lightgbm_*.tar.gz || exit
-
1
RD${{ matrix.r_customization }} CMD INSTALL lightgbm_*.tar.gz || exit 1
-
name
:
Run tests with sanitizers
-
name
:
Run tests with sanitizers
shell
:
bash
shell
:
bash
run
:
|
run
:
|
...
@@ -303,7 +303,7 @@ jobs:
...
@@ -303,7 +303,7 @@ jobs:
export PATH=/opt/R-devel/bin/:${PATH}
export PATH=/opt/R-devel/bin/:${PATH}
Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'testthat'), repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())"
Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'testthat'), repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())"
sh build-cran-package.sh
sh build-cran-package.sh
R CMD check --as-cran --run-donttest lightgbm_*.tar.gz || exit
-
1
R CMD check --as-cran --run-donttest lightgbm_*.tar.gz || exit 1
echo ""
echo ""
echo "install logs:"
echo "install logs:"
echo ""
echo ""
...
@@ -311,7 +311,7 @@ jobs:
...
@@ -311,7 +311,7 @@ jobs:
echo ""
echo ""
if grep -q -E "NOTE|WARNING|ERROR" lightgbm.Rcheck/00check.log; then
if grep -q -E "NOTE|WARNING|ERROR" lightgbm.Rcheck/00check.log; then
echo "NOTEs, WARNINGs, or ERRORs have been found by R CMD check"
echo "NOTEs, WARNINGs, or ERRORs have been found by R CMD check"
exit
-
1
exit 1
fi
fi
all-r-package-jobs-successful
:
all-r-package-jobs-successful
:
if
:
always()
if
:
always()
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment