Unverified Commit 35a2a2e3 authored by Nikita Titov's avatar Nikita Titov Committed by GitHub
Browse files

[ci] place all CI helpers under the .ci folder and use - instead of _ in their names (#6581)

parent 2f60e115
...@@ -39,4 +39,4 @@ test_script: ...@@ -39,4 +39,4 @@ test_script:
- conda config --add channels conda-forge - conda config --add channels conda-forge
- conda config --set channel_priority strict - conda config --set channel_priority strict
- conda init powershell - conda init powershell
- powershell.exe -ExecutionPolicy Bypass -File %APPVEYOR_BUILD_FOLDER%\.ci\test_windows.ps1 - powershell.exe -ExecutionPolicy Bypass -File %APPVEYOR_BUILD_FOLDER%\.ci\test-windows.ps1
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# Update comment appending a given body to the specified original comment. # Update comment appending a given body to the specified original comment.
# #
# [usage] # [usage]
# append_comment.sh <COMMENT_ID> <BODY> # append-comment.sh <COMMENT_ID> <BODY>
# #
# COMMENT_ID: ID of comment that should be modified. # COMMENT_ID: ID of comment that should be modified.
# #
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"""Get the most recent status of workflow for the current PR. """Get the most recent status of workflow for the current PR.
[usage] [usage]
python get_workflow_status.py TRIGGER_PHRASE python get-workflow-status.py TRIGGER_PHRASE
TRIGGER_PHRASE: Code phrase that triggers workflow. TRIGGER_PHRASE: Code phrase that triggers workflow.
""" """
......
...@@ -286,7 +286,7 @@ def gen_parameter_code( ...@@ -286,7 +286,7 @@ def gen_parameter_code(
* Licensed under the MIT License. See LICENSE file in the project root for license information. * Licensed under the MIT License. See LICENSE file in the project root for license information.
* *
* \note * \note
* This file is auto generated by LightGBM\helpers\parameter_generator.py from LightGBM\include\LightGBM\config.h file. * This file is auto generated by LightGBM\.ci\parameter-generator.py from LightGBM\include\LightGBM\config.h file.
*/ */
""" """
str_to_write += "#include<LightGBM/config.h>\nnamespace LightGBM {\n" str_to_write += "#include<LightGBM/config.h>\nnamespace LightGBM {\n"
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# Rerun specified workflow for given pull request. # Rerun specified workflow for given pull request.
# #
# [usage] # [usage]
# rerun_workflow.sh <WORKFLOW_ID> <PR_NUMBER> <PR_BRANCH> # rerun-workflow.sh <WORKFLOW_ID> <PR_NUMBER> <PR_BRANCH>
# #
# WORKFLOW_ID: Identifier (config name of ID) of a workflow to be rerun. # WORKFLOW_ID: Identifier (config name of ID) of a workflow to be rerun.
# #
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# Set a status with a given name to the specified commit. # Set a status with a given name to the specified commit.
# #
# [usage] # [usage]
# set_commit_status.sh <NAME> <STATUS> <SHA> # set-commit-status.sh <NAME> <STATUS> <SHA>
# #
# NAME: Name of status. # NAME: Name of status.
# Status with existing name overwrites a previous one. # Status with existing name overwrites a previous one.
......
...@@ -17,7 +17,7 @@ Remove-Item $env:TMPDIR -Force -Recurse -ErrorAction Ignore ...@@ -17,7 +17,7 @@ Remove-Item $env:TMPDIR -Force -Recurse -ErrorAction Ignore
[Void][System.IO.Directory]::CreateDirectory($env:TMPDIR) [Void][System.IO.Directory]::CreateDirectory($env:TMPDIR)
if ($env:TASK -eq "r-package") { if ($env:TASK -eq "r-package") {
& .\.ci\test_r_package_windows.ps1 ; Check-Output $? & .\.ci\test-r-package-windows.ps1 ; Check-Output $?
Exit 0 Exit 0
} }
...@@ -77,7 +77,7 @@ if ($env:TASK -eq "regular") { ...@@ -77,7 +77,7 @@ if ($env:TASK -eq "regular") {
} }
elseif ($env:TASK -eq "sdist") { elseif ($env:TASK -eq "sdist") {
sh ./build-python.sh sdist ; Check-Output $? sh ./build-python.sh sdist ; Check-Output $?
sh ./.ci/check_python_dists.sh ./dist ; Check-Output $? sh ./.ci/check-python-dists.sh ./dist ; Check-Output $?
cd dist; pip install @(Get-ChildItem *.gz) -v ; Check-Output $? cd dist; pip install @(Get-ChildItem *.gz) -v ; Check-Output $?
} }
elseif ($env:TASK -eq "bdist") { elseif ($env:TASK -eq "bdist") {
...@@ -92,7 +92,7 @@ elseif ($env:TASK -eq "bdist") { ...@@ -92,7 +92,7 @@ elseif ($env:TASK -eq "bdist") {
conda activate $env:CONDA_ENV conda activate $env:CONDA_ENV
sh "build-python.sh" bdist_wheel --integrated-opencl ; Check-Output $? sh "build-python.sh" bdist_wheel --integrated-opencl ; Check-Output $?
sh ./.ci/check_python_dists.sh ./dist ; Check-Output $? sh ./.ci/check-python-dists.sh ./dist ; Check-Output $?
cd dist; pip install @(Get-ChildItem *py3-none-win_amd64.whl) ; Check-Output $? cd dist; pip install @(Get-ChildItem *py3-none-win_amd64.whl) ; Check-Output $?
cp @(Get-ChildItem *py3-none-win_amd64.whl) $env:BUILD_ARTIFACTSTAGINGDIRECTORY cp @(Get-ChildItem *py3-none-win_amd64.whl) $env:BUILD_ARTIFACTSTAGINGDIRECTORY
} elseif (($env:APPVEYOR -eq "true") -and ($env:TASK -eq "python")) { } elseif (($env:APPVEYOR -eq "true") -and ($env:TASK -eq "python")) {
......
...@@ -43,7 +43,7 @@ else ...@@ -43,7 +43,7 @@ else
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
...@@ -86,7 +86,7 @@ if [[ $TASK == "swig" ]]; then ...@@ -86,7 +86,7 @@ if [[ $TASK == "swig" ]]; then
if [[ $OS_NAME == "linux" ]] && [[ $COMPILER == "gcc" ]]; then if [[ $OS_NAME == "linux" ]] && [[ $COMPILER == "gcc" ]]; then
objdump -T ./lib_lightgbm.so > ./objdump.log || exit 1 objdump -T ./lib_lightgbm.so > ./objdump.log || exit 1
objdump -T ./lib_lightgbm_swig.so >> ./objdump.log || exit 1 objdump -T ./lib_lightgbm_swig.so >> ./objdump.log || exit 1
python ./helpers/check_dynamic_dependencies.py ./objdump.log || exit 1 python ./.ci/check-dynamic-dependencies.py ./objdump.log || exit 1
fi fi
if [[ $PRODUCES_ARTIFACTS == "true" ]]; then if [[ $PRODUCES_ARTIFACTS == "true" ]]; then
cp ./build/lightgbmlib.jar $BUILD_ARTIFACTSTAGINGDIRECTORY/lightgbmlib_$OS_NAME.jar cp ./build/lightgbmlib.jar $BUILD_ARTIFACTSTAGINGDIRECTORY/lightgbmlib_$OS_NAME.jar
...@@ -108,7 +108,7 @@ if [[ $TASK == "lint" ]]; then ...@@ -108,7 +108,7 @@ if [[ $TASK == "lint" ]]; then
echo "Linting Python code" echo "Linting Python code"
bash ./.ci/lint-python.sh || exit 1 bash ./.ci/lint-python.sh || exit 1
echo "Linting R code" echo "Linting R code"
Rscript ./.ci/lint_r_code.R "${BUILD_DIRECTORY}" || exit 1 Rscript ./.ci/lint-r-code.R "${BUILD_DIRECTORY}" || exit 1
echo "Linting C++ code" echo "Linting C++ code"
bash ./.ci/lint-cpp.sh || exit 1 bash ./.ci/lint-cpp.sh || exit 1
exit 0 exit 0
...@@ -143,7 +143,7 @@ if [[ $TASK == "check-docs" ]] || [[ $TASK == "check-links" ]]; then ...@@ -143,7 +143,7 @@ if [[ $TASK == "check-docs" ]] || [[ $TASK == "check-links" ]]; then
cd "${BUILD_DIRECTORY}" cd "${BUILD_DIRECTORY}"
cp ./docs/Parameters.rst ./docs/Parameters-backup.rst cp ./docs/Parameters.rst ./docs/Parameters-backup.rst
cp ./src/io/config_auto.cpp ./src/io/config_auto-backup.cpp cp ./src/io/config_auto.cpp ./src/io/config_auto-backup.cpp
python ./helpers/parameter_generator.py || exit 1 python ./.ci/parameter-generator.py || exit 1
diff ./docs/Parameters-backup.rst ./docs/Parameters.rst || exit 1 diff ./docs/Parameters-backup.rst ./docs/Parameters.rst || exit 1
diff ./src/io/config_auto-backup.cpp ./src/io/config_auto.cpp || exit 1 diff ./src/io/config_auto-backup.cpp ./src/io/config_auto.cpp || exit 1
exit 0 exit 0
...@@ -170,7 +170,7 @@ cd "${BUILD_DIRECTORY}" ...@@ -170,7 +170,7 @@ cd "${BUILD_DIRECTORY}"
if [[ $TASK == "sdist" ]]; then if [[ $TASK == "sdist" ]]; then
sh ./build-python.sh sdist || exit 1 sh ./build-python.sh sdist || exit 1
sh .ci/check_python_dists.sh ./dist || exit 1 sh .ci/check-python-dists.sh ./dist || exit 1
pip install ./dist/lightgbm-$LGB_VER.tar.gz -v || exit 1 pip install ./dist/lightgbm-$LGB_VER.tar.gz -v || exit 1
if [[ $PRODUCES_ARTIFACTS == "true" ]]; then if [[ $PRODUCES_ARTIFACTS == "true" ]]; then
cp ./dist/lightgbm-$LGB_VER.tar.gz $BUILD_ARTIFACTSTAGINGDIRECTORY || exit 1 cp ./dist/lightgbm-$LGB_VER.tar.gz $BUILD_ARTIFACTSTAGINGDIRECTORY || exit 1
...@@ -180,7 +180,7 @@ if [[ $TASK == "sdist" ]]; then ...@@ -180,7 +180,7 @@ if [[ $TASK == "sdist" ]]; then
elif [[ $TASK == "bdist" ]]; then elif [[ $TASK == "bdist" ]]; then
if [[ $OS_NAME == "macos" ]]; then if [[ $OS_NAME == "macos" ]]; then
sh ./build-python.sh bdist_wheel || exit 1 sh ./build-python.sh bdist_wheel || exit 1
sh .ci/check_python_dists.sh ./dist || exit 1 sh .ci/check-python-dists.sh ./dist || 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
...@@ -199,7 +199,7 @@ elif [[ $TASK == "bdist" ]]; then ...@@ -199,7 +199,7 @@ elif [[ $TASK == "bdist" ]]; then
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 .ci/check_python_dists.sh ./dist || exit 1 sh .ci/check-python-dists.sh ./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
...@@ -216,7 +216,7 @@ if [[ $TASK == "gpu" ]]; then ...@@ -216,7 +216,7 @@ if [[ $TASK == "gpu" ]]; then
grep -q 'std::string device_type = "gpu"' ./include/LightGBM/config.h || exit 1 # make sure that changes were really done grep -q 'std::string device_type = "gpu"' ./include/LightGBM/config.h || exit 1 # make sure that changes were really done
if [[ $METHOD == "pip" ]]; then if [[ $METHOD == "pip" ]]; then
sh ./build-python.sh sdist || exit 1 sh ./build-python.sh sdist || exit 1
sh .ci/check_python_dists.sh ./dist || exit 1 sh .ci/check-python-dists.sh ./dist || exit 1
pip install \ pip install \
-v \ -v \
--config-settings=cmake.define.USE_GPU=ON \ --config-settings=cmake.define.USE_GPU=ON \
...@@ -226,7 +226,7 @@ if [[ $TASK == "gpu" ]]; then ...@@ -226,7 +226,7 @@ if [[ $TASK == "gpu" ]]; then
exit 0 exit 0
elif [[ $METHOD == "wheel" ]]; then elif [[ $METHOD == "wheel" ]]; then
sh ./build-python.sh bdist_wheel --gpu || exit 1 sh ./build-python.sh bdist_wheel --gpu || exit 1
sh ./.ci/check_python_dists.sh ./dist || exit 1 sh ./.ci/check-python-dists.sh ./dist || exit 1
pip install ./dist/lightgbm-$LGB_VER*.whl -v || exit 1 pip install ./dist/lightgbm-$LGB_VER*.whl -v || exit 1
pytest ./tests || exit 1 pytest ./tests || exit 1
exit 0 exit 0
...@@ -241,7 +241,7 @@ elif [[ $TASK == "cuda" ]]; then ...@@ -241,7 +241,7 @@ elif [[ $TASK == "cuda" ]]; then
grep -q 'gpu_use_dp = true' ./include/LightGBM/config.h || exit 1 # make sure that changes were really done grep -q 'gpu_use_dp = true' ./include/LightGBM/config.h || exit 1 # make sure that changes were really done
if [[ $METHOD == "pip" ]]; then if [[ $METHOD == "pip" ]]; then
sh ./build-python.sh sdist || exit 1 sh ./build-python.sh sdist || exit 1
sh ./.ci/check_python_dists.sh ./dist || exit 1 sh ./.ci/check-python-dists.sh ./dist || exit 1
pip install \ pip install \
-v \ -v \
--config-settings=cmake.define.USE_CUDA=ON \ --config-settings=cmake.define.USE_CUDA=ON \
...@@ -251,7 +251,7 @@ elif [[ $TASK == "cuda" ]]; then ...@@ -251,7 +251,7 @@ elif [[ $TASK == "cuda" ]]; then
exit 0 exit 0
elif [[ $METHOD == "wheel" ]]; then elif [[ $METHOD == "wheel" ]]; then
sh ./build-python.sh bdist_wheel --cuda || exit 1 sh ./build-python.sh bdist_wheel --cuda || exit 1
sh ./.ci/check_python_dists.sh ./dist || exit 1 sh ./.ci/check-python-dists.sh ./dist || exit 1
pip install ./dist/lightgbm-$LGB_VER*.whl -v || exit 1 pip install ./dist/lightgbm-$LGB_VER*.whl -v || exit 1
pytest ./tests || exit 1 pytest ./tests || exit 1
exit 0 exit 0
...@@ -261,7 +261,7 @@ elif [[ $TASK == "cuda" ]]; then ...@@ -261,7 +261,7 @@ elif [[ $TASK == "cuda" ]]; then
elif [[ $TASK == "mpi" ]]; then elif [[ $TASK == "mpi" ]]; then
if [[ $METHOD == "pip" ]]; then if [[ $METHOD == "pip" ]]; then
sh ./build-python.sh sdist || exit 1 sh ./build-python.sh sdist || exit 1
sh ./.ci/check_python_dists.sh ./dist || exit 1 sh ./.ci/check-python-dists.sh ./dist || exit 1
pip install \ pip install \
-v \ -v \
--config-settings=cmake.define.USE_MPI=ON \ --config-settings=cmake.define.USE_MPI=ON \
...@@ -271,7 +271,7 @@ elif [[ $TASK == "mpi" ]]; then ...@@ -271,7 +271,7 @@ elif [[ $TASK == "mpi" ]]; then
exit 0 exit 0
elif [[ $METHOD == "wheel" ]]; then elif [[ $METHOD == "wheel" ]]; then
sh ./build-python.sh bdist_wheel --mpi || exit 1 sh ./build-python.sh bdist_wheel --mpi || exit 1
sh ./.ci/check_python_dists.sh ./dist || exit 1 sh ./.ci/check-python-dists.sh ./dist || exit 1
pip install ./dist/lightgbm-$LGB_VER*.whl -v || exit 1 pip install ./dist/lightgbm-$LGB_VER*.whl -v || exit 1
pytest ./tests || exit 1 pytest ./tests || exit 1
exit 0 exit 0
...@@ -294,7 +294,7 @@ if [[ $TASK == "regular" ]]; then ...@@ -294,7 +294,7 @@ if [[ $TASK == "regular" ]]; then
else else
if [[ $COMPILER == "gcc" ]]; then if [[ $COMPILER == "gcc" ]]; then
objdump -T ./lib_lightgbm.so > ./objdump.log || exit 1 objdump -T ./lib_lightgbm.so > ./objdump.log || exit 1
python ./helpers/check_dynamic_dependencies.py ./objdump.log || exit 1 python ./.ci/check-dynamic-dependencies.py ./objdump.log || exit 1
fi fi
cp ./lib_lightgbm.so $BUILD_ARTIFACTSTAGINGDIRECTORY/lib_lightgbm.so cp ./lib_lightgbm.so $BUILD_ARTIFACTSTAGINGDIRECTORY/lib_lightgbm.so
fi fi
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# Trigger manual workflow run by a dispatch event. # Trigger manual workflow run by a dispatch event.
# #
# [usage] # [usage]
# trigger_dispatch_run.sh <PR_URL> <COMMENT_ID> <DISPATCH_NAME> # trigger-dispatch-run.sh <PR_URL> <COMMENT_ID> <DISPATCH_NAME>
# #
# PR_URL: URL of pull request from which dispatch is triggering. # PR_URL: URL of pull request from which dispatch is triggering.
# #
......
...@@ -23,7 +23,7 @@ jobs: ...@@ -23,7 +23,7 @@ jobs:
for i in "${workflows[@]}"; do for i in "${workflows[@]}"; do
workflow_name=${i%;*} workflow_name=${i%;*}
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
...@@ -226,7 +226,7 @@ jobs: ...@@ -226,7 +226,7 @@ jobs:
$env:R_BUILD_TYPE = "${{ matrix.build_type }}" $env:R_BUILD_TYPE = "${{ matrix.build_type }}"
$env:COMPILER = "${{ matrix.compiler }}" $env:COMPILER = "${{ matrix.compiler }}"
$env:TASK = "${{ matrix.task }}" $env:TASK = "${{ matrix.task }}"
& "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1" & "$env:GITHUB_WORKSPACE/.ci/test-windows.ps1"
test-r-sanitizers: test-r-sanitizers:
name: r-sanitizers (ubuntu-latest, R-devel, ${{ matrix.compiler }} ASAN/UBSAN) name: r-sanitizers (ubuntu-latest, R-devel, ${{ matrix.compiler }} ASAN/UBSAN)
timeout-minutes: 60 timeout-minutes: 60
......
...@@ -33,24 +33,24 @@ jobs: ...@@ -33,24 +33,24 @@ jobs:
- name: Send init status - name: Send init status
if: ${{ always() }} if: ${{ always() }}
run: | run: |
$GITHUB_WORKSPACE/.ci/set_commit_status.sh "${{ github.workflow }}" "pending" "${{ github.event.client_payload.pr_sha }}" $GITHUB_WORKSPACE/.ci/set-commit-status.sh "${{ github.workflow }}" "pending" "${{ github.event.client_payload.pr_sha }}"
$GITHUB_WORKSPACE/.ci/append_comment.sh \ $GITHUB_WORKSPACE/.ci/append-comment.sh \
"${{ github.event.client_payload.comment_number }}" \ "${{ github.event.client_payload.comment_number }}" \
"Workflow **${{ github.workflow }}** has been triggered! 🚀\r\n${GITHUB_SERVER_URL}/microsoft/LightGBM/actions/runs/${GITHUB_RUN_ID}" "Workflow **${{ github.workflow }}** has been triggered! 🚀\r\n${GITHUB_SERVER_URL}/microsoft/LightGBM/actions/runs/${GITHUB_RUN_ID}"
- name: Run tests with valgrind - name: Run tests with valgrind
shell: bash shell: bash
run: ./.ci/test_r_package_valgrind.sh run: ./.ci/test-r-package-valgrind.sh
- name: Send final status - name: Send final status
if: ${{ always() }} if: ${{ always() }}
run: | run: |
$GITHUB_WORKSPACE/.ci/set_commit_status.sh "${{ github.workflow }}" "${{ job.status }}" "${{ github.event.client_payload.pr_sha }}" $GITHUB_WORKSPACE/.ci/set-commit-status.sh "${{ github.workflow }}" "${{ job.status }}" "${{ github.event.client_payload.pr_sha }}"
$GITHUB_WORKSPACE/.ci/append_comment.sh \ $GITHUB_WORKSPACE/.ci/append-comment.sh \
"${{ github.event.client_payload.comment_number }}" \ "${{ github.event.client_payload.comment_number }}" \
"Status: ${{ job.status }}." "Status: ${{ job.status }}."
- name: Rerun workflow-indicator - name: Rerun workflow-indicator
if: ${{ always() }} if: ${{ always() }}
run: | run: |
bash $GITHUB_WORKSPACE/.ci/rerun_workflow.sh \ bash $GITHUB_WORKSPACE/.ci/rerun-workflow.sh \
"optional_checks.yml" \ "optional_checks.yml" \
"${{ github.event.client_payload.pr_number }}" \ "${{ github.event.client_payload.pr_number }}" \
"${{ github.event.client_payload.pr_branch }}" \ "${{ github.event.client_payload.pr_branch }}" \
......
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