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