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

This commit is contained in:
Nikita Titov 2024-07-31 16:36:20 +03:00 коммит произвёл GitHub
Родитель 2f60e115a8
Коммит 35a2a2e379
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
25 изменённых файлов: 40 добавлений и 40 удалений

Просмотреть файл

@ -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.
#

2
.github/workflows/optional_checks.yml поставляемый
Просмотреть файл

@ -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

2
.github/workflows/r_package.yml поставляемый
Просмотреть файл

@ -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

12
.github/workflows/r_valgrind.yml поставляемый
Просмотреть файл

@ -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 }}" \

4
.github/workflows/triggering_comments.yml поставляемый
Просмотреть файл

@ -20,7 +20,7 @@ jobs:
- name: Trigger R valgrind tests
if: github.event.comment.body == '/gha run r-valgrind'
run: |
$GITHUB_WORKSPACE/.ci/trigger_dispatch_run.sh \
$GITHUB_WORKSPACE/.ci/trigger-dispatch-run.sh \
"${{ github.event.issue.pull_request.url }}" \
"${{ github.event.comment.id }}" \
"gha_run_r_valgrind"
@ -28,7 +28,7 @@ jobs:
- name: Trigger update R configure
if: github.event.comment.body == '/gha run r-configure'
run: |
$GITHUB_WORKSPACE/.ci/trigger_dispatch_run.sh \
$GITHUB_WORKSPACE/.ci/trigger-dispatch-run.sh \
"${{ github.event.issue.pull_request.url }}" \
"${{ github.event.comment.id }}" \
"gha_run_r_configure"

Просмотреть файл

@ -328,7 +328,7 @@ jobs:
git clean -d -f -x
displayName: 'Clean source directory'
- script: |
cmd /c "powershell -ExecutionPolicy Bypass -File %BUILD_SOURCESDIRECTORY%/.ci/install_opencl.ps1"
cmd /c "powershell -ExecutionPolicy Bypass -File %BUILD_SOURCESDIRECTORY%/.ci/install-opencl.ps1"
condition: eq(variables['TASK'], 'bdist')
displayName: 'Install OpenCL'
- script: |
@ -337,7 +337,7 @@ jobs:
cmd /c "conda config --add channels conda-forge"
cmd /c "conda config --set channel_priority strict"
cmd /c "conda init powershell"
cmd /c "powershell -ExecutionPolicy Bypass -File %BUILD_SOURCESDIRECTORY%/.ci/test_windows.ps1"
cmd /c "powershell -ExecutionPolicy Bypass -File %BUILD_SOURCESDIRECTORY%/.ci/test-windows.ps1"
displayName: Test
- task: PublishBuildArtifacts@1
condition: and(succeeded(), in(variables['TASK'], 'regular', 'bdist', 'swig'), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
@ -419,7 +419,7 @@ jobs:
artifactName: R-package
downloadPath: $(Build.SourcesDirectory)/R
- script: |
python "$(Build.SourcesDirectory)/.nuget/create_nuget.py" "$(Build.SourcesDirectory)/binaries/PackageAssets"
python "$(Build.SourcesDirectory)/.ci/create-nuget.py" "$(Build.SourcesDirectory)/binaries/PackageAssets"
displayName: 'Create NuGet configuration files'
- task: NuGetCommand@2
inputs:

Просмотреть файл

@ -1,4 +1,4 @@
.. List of parameters is auto generated by LightGBM\helpers\parameter_generator.py from LightGBM\include\LightGBM\config.h file.
.. List of parameters is auto generated by LightGBM\.ci\parameter-generator.py from LightGBM\include\LightGBM\config.h file.
.. role:: raw-html(raw)
:format: html

Просмотреть файл

@ -6,7 +6,7 @@ and `Breathe <https://breathe.readthedocs.io/>`__, which works on top of `Doxyge
List of parameters and their descriptions in `Parameters.rst <./Parameters.rst>`__
is generated automatically from comments in `config file <https://github.com/microsoft/LightGBM/blob/master/include/LightGBM/config.h>`__
by `this script <https://github.com/microsoft/LightGBM/blob/master/helpers/parameter_generator.py>`__.
by `this script <https://github.com/microsoft/LightGBM/blob/master/.ci/parameter-generator.py>`__.
After each commit on ``master``, documentation is updated and published to `Read the Docs <https://lightgbm.readthedocs.io/>`__.

Просмотреть файл

@ -3,7 +3,7 @@
* 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.
*/
#include<LightGBM/config.h>
namespace LightGBM {