Skip to content

Commit 425395d

Browse files
authored
[ci] fix errors about comments indentation in yaml files (Part 4) (#6804)
* ci/yamlint-4 * dev * dev * dev * dev * dev * dev * Update optional_checks.yml * Update lock.yml * Update optional_checks.yml
1 parent 9f1af05 commit 425395d

10 files changed

+81
-23
lines changed

.github/workflows/cuda.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,12 @@ jobs:
4343
software-properties-common
4444
# set up nvidia-docker
4545
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
46-
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" -y
46+
sudo add-apt-repository -y \
47+
"deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
4748
curl -sL https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
48-
curl -sL https://nvidia.github.io/nvidia-docker/$(. /etc/os-release;echo $ID$VERSION_ID)/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
49+
curl -sL \
50+
https://nvidia.github.io/nvidia-docker/$(. /etc/os-release;echo $ID$VERSION_ID)/nvidia-docker.list \
51+
| sudo tee /etc/apt/sources.list.d/nvidia-docker.list
4952
sudo apt-get update
5053
sudo apt-get install --no-install-recommends -y \
5154
containerd.io \
@@ -58,6 +61,7 @@ jobs:
5861
run: |
5962
exit 0
6063
test:
64+
# yamllint disable-line rule:line-length
6165
name: ${{ matrix.task }} ${{ matrix.cuda_version }} ${{ matrix.method }} (${{ matrix.linux_version }}, ${{ matrix.compiler }}, Python ${{ matrix.python_version }})
6266
runs-on: [self-hosted, linux]
6367
needs: [restart-docker]

.github/workflows/lock.yml

+10-4
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,18 @@ jobs:
3434
remove-pr-labels: 'awaiting response,awaiting review,blocking,in progress'
3535
# what message should be posted prior to locking?
3636
issue-comment: >
37-
This issue has been automatically locked since there has not been any recent activity since it was closed.
38-
To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues
37+
This issue has been automatically locked
38+
since there has not been any recent activity since it was closed.
39+
40+
To start a new related discussion,
41+
open a new issue at https://github.com/microsoft/LightGBM/issues
3942
including a reference to this.
4043
pr-comment: >
41-
This pull request has been automatically locked since there has not been any recent activity since it was closed.
42-
To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues
44+
This pull request has been automatically locked
45+
since there has not been any recent activity since it was closed.
46+
47+
To start a new related discussion,
48+
open a new issue at https://github.com/microsoft/LightGBM/issues
4349
including a reference to this.
4450
# what should the locking status be?
4551
issue-lock-reason: 'resolved'

.github/workflows/no_response.yml

+8-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,14 @@ jobs:
1818
- uses: lee-dohm/[email protected]
1919
with:
2020
closeComment: >
21-
This issue has been automatically closed because it has been awaiting a response for too long.
22-
When you have time to to work with the maintainers to resolve this issue, please post a new comment and it will be re-opened.
23-
If the issue has been locked for editing by the time you return to it, please open a new issue and reference this one.
21+
This issue has been automatically closed
22+
because it has been awaiting a response for too long.
23+
24+
When you have time to to work with the maintainers to resolve this issue,
25+
please post a new comment and it will be re-opened.
26+
If the issue has been locked for editing by the time you return to it,
27+
please open a new issue and reference this one.
28+
2429
Thank you for taking the time to improve LightGBM!
2530
daysUntilClose: 30
2631
responseRequiredLabel: awaiting response

.github/workflows/optional_checks.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ jobs:
2222
)
2323
for i in "${workflows[@]}"; do
2424
workflow_name=${i%;*}
25+
comment="The last reported status from workflow \"$workflow_name\" is failure."
26+
comment+=" Commit fixes and rerun the workflow."
2527
trigger_phrase=${i#*;}
26-
python "$GITHUB_WORKSPACE/.ci/get-workflow-status.py" "$trigger_phrase" \
27-
|| { echo "The last reported status from workflow \"$workflow_name\" is failure. Commit fixes and rerun the workflow."; \
28-
exit 1; }
28+
python \
29+
"$GITHUB_WORKSPACE/.ci/get-workflow-status.py" \
30+
"$trigger_phrase" \
31+
|| { echo "${comment}"; exit 1; }
2932
done

.github/workflows/r_package.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ env:
4747

4848
jobs:
4949
test:
50+
# yamllint disable-line rule:line-length
5051
name: ${{ matrix.task }} (${{ matrix.os }}, ${{ matrix.compiler }}, R ${{ matrix.r_version }}, ${{ matrix.build_type }})
5152
runs-on: ${{ matrix.os }}
5253
container: ${{ matrix.container }}
@@ -244,7 +245,9 @@ jobs:
244245
- name: Install packages
245246
shell: bash
246247
run: |
247-
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())"
248+
R_LIBS="c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'testthat')"
249+
RDscript${{ matrix.r_customization }} \
250+
-e "install.packages(${R_LIBS}, repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())"
248251
sh build-cran-package.sh --r-executable=RD${{ matrix.r_customization }}
249252
RD${{ matrix.r_customization }} CMD INSTALL lightgbm_*.tar.gz || exit 1
250253
- name: Run tests with sanitizers
@@ -309,7 +312,9 @@ jobs:
309312
- name: Install packages and run tests
310313
shell: bash
311314
run: |
312-
Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl'), repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())"
315+
R_LIBS="c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl')"
316+
Rscript \
317+
-e "install.packages(${R_LIBS}, repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())"
313318
sh build-cran-package.sh
314319
315320
# 'rchk' isn't run through 'R CMD check', use the approach documented at

.github/workflows/r_valgrind.yml

+11-3
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,25 @@ jobs:
3333
- name: Send init status
3434
if: ${{ always() }}
3535
run: |
36-
$GITHUB_WORKSPACE/.ci/set-commit-status.sh "${{ github.workflow }}" "pending" "${{ github.event.client_payload.pr_sha }}"
36+
$GITHUB_WORKSPACE/.ci/set-commit-status.sh \
37+
"${{ github.workflow }}" \
38+
"pending" \
39+
"${{ github.event.client_payload.pr_sha }}"
40+
comment="Workflow **${{ github.workflow }}** has been triggered! 🚀\r\n"
41+
comment+="${GITHUB_SERVER_URL}/microsoft/LightGBM/actions/runs/${GITHUB_RUN_ID}"
3742
$GITHUB_WORKSPACE/.ci/append-comment.sh \
3843
"${{ github.event.client_payload.comment_number }}" \
39-
"Workflow **${{ github.workflow }}** has been triggered! 🚀\r\n${GITHUB_SERVER_URL}/microsoft/LightGBM/actions/runs/${GITHUB_RUN_ID}"
44+
"${comment}"
4045
- name: Run tests with valgrind
4146
shell: bash
4247
run: ./.ci/test-r-package-valgrind.sh
4348
- name: Send final status
4449
if: ${{ always() }}
4550
run: |
46-
$GITHUB_WORKSPACE/.ci/set-commit-status.sh "${{ github.workflow }}" "${{ job.status }}" "${{ github.event.client_payload.pr_sha }}"
51+
$GITHUB_WORKSPACE/.ci/set-commit-status.sh \
52+
"${{ github.workflow }}" \
53+
"${{ job.status }}" \
54+
"${{ github.event.client_payload.pr_sha }}"
4755
$GITHUB_WORKSPACE/.ci/append-comment.sh \
4856
"${{ github.event.client_payload.comment_number }}" \
4957
"Status: ${{ job.status }}."

.github/workflows/static_analysis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,12 @@ jobs:
6363
submodules: true
6464
- name: Install packages
6565
shell: bash
66+
# yamllint disable rule:line-length
6667
run: |
6768
Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'roxygen2', 'testthat'), repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())"
6869
sh build-cran-package.sh || exit 1
6970
R CMD INSTALL --with-keep.source lightgbm_*.tar.gz || exit 1
71+
# yamllint enable rule:line-length
7072
- name: Test documentation
7173
shell: bash --noprofile --norc {0}
7274
run: |

.github/workflows/triggering_comments.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ on:
66

77
jobs:
88
triggering-tests:
9-
if: github.event.issue.pull_request && contains('OWNER,MEMBER,COLLABORATOR', github.event.comment.author_association) && startsWith(github.event.comment.body, '/gha run')
9+
if: |
10+
github.event.issue.pull_request &&
11+
contains('OWNER,MEMBER,COLLABORATOR', github.event.comment.author_association) &&
12+
startsWith(github.event.comment.body, '/gha run')
1013
runs-on: ubuntu-latest
1114
env:
1215
SECRETS_WORKFLOW: ${{ secrets.WORKFLOW }}

.vsts-ci.yml

+26-4
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,12 @@ jobs:
137137
filePath: $(Build.SourcesDirectory)/.ci/test.sh
138138
targetType: filePath
139139
- task: PublishBuildArtifacts@1
140-
condition: and(succeeded(), in(variables['TASK'], 'regular', 'sdist', 'bdist', 'swig'), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
140+
condition: >
141+
and(
142+
succeeded(),
143+
in(variables['TASK'], 'regular', 'sdist', 'bdist', 'swig'),
144+
not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))
145+
)
141146
inputs:
142147
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
143148
artifactName: PackageAssets
@@ -279,7 +284,12 @@ jobs:
279284
/bin/bash $BUILD_DIRECTORY/docker-script.sh
280285
displayName: 'Setup and run tests'
281286
- task: PublishBuildArtifacts@1
282-
condition: and(succeeded(), in(variables['TASK'], 'bdist'), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
287+
condition: >
288+
and(
289+
succeeded(),
290+
in(variables['TASK'], 'bdist'),
291+
not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))
292+
)
283293
inputs:
284294
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
285295
artifactName: PackageAssets
@@ -332,7 +342,12 @@ jobs:
332342
filePath: $(Build.SourcesDirectory)/.ci/test.sh
333343
targetType: filePath
334344
- task: PublishBuildArtifacts@1
335-
condition: and(succeeded(), in(variables['TASK'], 'regular', 'bdist', 'swig'), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
345+
condition: >
346+
and(
347+
succeeded(),
348+
in(variables['TASK'], 'regular', 'bdist', 'swig'),
349+
not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))
350+
)
336351
inputs:
337352
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
338353
artifactName: PackageAssets
@@ -377,7 +392,12 @@ jobs:
377392
cmd /c "powershell -ExecutionPolicy Bypass -File %BUILD_SOURCESDIRECTORY%/.ci/test-windows.ps1"
378393
displayName: Test
379394
- task: PublishBuildArtifacts@1
380-
condition: and(succeeded(), in(variables['TASK'], 'regular', 'bdist', 'swig'), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
395+
condition: >
396+
and(
397+
succeeded(),
398+
in(variables['TASK'], 'regular', 'bdist', 'swig'),
399+
not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))
400+
)
381401
inputs:
382402
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
383403
artifactName: PackageAssets
@@ -394,6 +414,7 @@ jobs:
394414
- script: |
395415
git clean -d -f -x
396416
displayName: 'Clean source directory'
417+
# yamllint disable rule:line-length
397418
- script: |
398419
LGB_VER=$(head -n 1 VERSION.txt | sed "s/rc/-/g")
399420
R_LIB_PATH=~/Rlib
@@ -402,6 +423,7 @@ jobs:
402423
RDscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl'), lib = '${R_LIB_PATH}', dependencies = c('Depends', 'Imports', 'LinkingTo'), repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())" || exit 1
403424
sh build-cran-package.sh --r-executable=RD || exit 1
404425
mv lightgbm_${LGB_VER}.tar.gz $(Build.ArtifactStagingDirectory)/lightgbm-${LGB_VER}-r-cran.tar.gz
426+
# yamllint enable rule:line-length
405427
displayName: 'Build CRAN R-package'
406428
- task: PublishBuildArtifacts@1
407429
condition: succeeded()

.yamllint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ extends: default
44
rules:
55
document-start: disable
66
line-length:
7-
max: 999 # temporarily increase allowed line length
7+
max: 120
88
truthy:
99
# prevent treating GitHub Workflow "on" key as boolean value
1010
check-keys: false

0 commit comments

Comments
 (0)