Skip to content

Commit

Permalink
[ci] fix errors about comments indentation in yaml files (Part 4) (#6804
Browse files Browse the repository at this point in the history
)

* ci/yamlint-4

* dev

* dev

* dev

* dev

* dev

* dev

* Update optional_checks.yml

* Update lock.yml

* Update optional_checks.yml
  • Loading branch information
StrikerRUS authored Jan 30, 2025
1 parent 9f1af05 commit 425395d
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 23 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ jobs:
software-properties-common
# set up nvidia-docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" -y
sudo add-apt-repository -y \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
curl -sL https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
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
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
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
containerd.io \
Expand All @@ -58,6 +61,7 @@ jobs:
run: |
exit 0
test:
# yamllint disable-line rule:line-length
name: ${{ matrix.task }} ${{ matrix.cuda_version }} ${{ matrix.method }} (${{ matrix.linux_version }}, ${{ matrix.compiler }}, Python ${{ matrix.python_version }})
runs-on: [self-hosted, linux]
needs: [restart-docker]
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,18 @@ jobs:
remove-pr-labels: 'awaiting response,awaiting review,blocking,in progress'
# what message should be posted prior to locking?
issue-comment: >
This issue has been automatically locked since there has not been any recent activity since it was closed.
To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues
This issue has been automatically locked
since there has not been any recent activity since it was closed.
To start a new related discussion,
open a new issue at https://github.com/microsoft/LightGBM/issues
including a reference to this.
pr-comment: >
This pull request has been automatically locked since there has not been any recent activity since it was closed.
To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues
This pull request has been automatically locked
since there has not been any recent activity since it was closed.
To start a new related discussion,
open a new issue at https://github.com/microsoft/LightGBM/issues
including a reference to this.
# what should the locking status be?
issue-lock-reason: 'resolved'
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/no_response.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@ jobs:
- uses: lee-dohm/[email protected]
with:
closeComment: >
This issue has been automatically closed because it has been awaiting a response for too long.
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.
If the issue has been locked for editing by the time you return to it, please open a new issue and reference this one.
This issue has been automatically closed
because it has been awaiting a response for too long.
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.
If the issue has been locked for editing by the time you return to it,
please open a new issue and reference this one.
Thank you for taking the time to improve LightGBM!
daysUntilClose: 30
responseRequiredLabel: awaiting response
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/optional_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ jobs:
)
for i in "${workflows[@]}"; do
workflow_name=${i%;*}
comment="The last reported status from workflow \"$workflow_name\" is failure."
comment+=" Commit fixes and rerun the workflow."
trigger_phrase=${i#*;}
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; }
python \
"$GITHUB_WORKSPACE/.ci/get-workflow-status.py" \
"$trigger_phrase" \
|| { echo "${comment}"; exit 1; }
done
9 changes: 7 additions & 2 deletions .github/workflows/r_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ env:

jobs:
test:
# yamllint disable-line rule:line-length
name: ${{ matrix.task }} (${{ matrix.os }}, ${{ matrix.compiler }}, R ${{ matrix.r_version }}, ${{ matrix.build_type }})
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
Expand Down Expand Up @@ -244,7 +245,9 @@ jobs:
- name: Install packages
shell: bash
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())"
R_LIBS="c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'testthat')"
RDscript${{ matrix.r_customization }} \
-e "install.packages(${R_LIBS}, repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())"
sh build-cran-package.sh --r-executable=RD${{ matrix.r_customization }}
RD${{ matrix.r_customization }} CMD INSTALL lightgbm_*.tar.gz || exit 1
- name: Run tests with sanitizers
Expand Down Expand Up @@ -309,7 +312,9 @@ jobs:
- name: Install packages and run tests
shell: bash
run: |
Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl'), repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())"
R_LIBS="c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl')"
Rscript \
-e "install.packages(${R_LIBS}, repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())"
sh build-cran-package.sh
# 'rchk' isn't run through 'R CMD check', use the approach documented at
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/r_valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,25 @@ 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/set-commit-status.sh \
"${{ github.workflow }}" \
"pending" \
"${{ github.event.client_payload.pr_sha }}"
comment="Workflow **${{ github.workflow }}** has been triggered! 🚀\r\n"
comment+="${GITHUB_SERVER_URL}/microsoft/LightGBM/actions/runs/${GITHUB_RUN_ID}"
$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}"
"${comment}"
- name: Run tests with valgrind
shell: bash
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/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 }}."
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ jobs:
submodules: true
- name: Install packages
shell: bash
# yamllint disable rule:line-length
run: |
Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'roxygen2', 'testthat'), repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())"
sh build-cran-package.sh || exit 1
R CMD INSTALL --with-keep.source lightgbm_*.tar.gz || exit 1
# yamllint enable rule:line-length
- name: Test documentation
shell: bash --noprofile --norc {0}
run: |
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/triggering_comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ on:

jobs:
triggering-tests:
if: github.event.issue.pull_request && contains('OWNER,MEMBER,COLLABORATOR', github.event.comment.author_association) && startsWith(github.event.comment.body, '/gha run')
if: |
github.event.issue.pull_request &&
contains('OWNER,MEMBER,COLLABORATOR', github.event.comment.author_association) &&
startsWith(github.event.comment.body, '/gha run')
runs-on: ubuntu-latest
env:
SECRETS_WORKFLOW: ${{ secrets.WORKFLOW }}
Expand Down
30 changes: 26 additions & 4 deletions .vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,12 @@ jobs:
filePath: $(Build.SourcesDirectory)/.ci/test.sh
targetType: filePath
- task: PublishBuildArtifacts@1
condition: and(succeeded(), in(variables['TASK'], 'regular', 'sdist', 'bdist', 'swig'), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
condition: >
and(
succeeded(),
in(variables['TASK'], 'regular', 'sdist', 'bdist', 'swig'),
not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))
)
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: PackageAssets
Expand Down Expand Up @@ -279,7 +284,12 @@ jobs:
/bin/bash $BUILD_DIRECTORY/docker-script.sh
displayName: 'Setup and run tests'
- task: PublishBuildArtifacts@1
condition: and(succeeded(), in(variables['TASK'], 'bdist'), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
condition: >
and(
succeeded(),
in(variables['TASK'], 'bdist'),
not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))
)
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: PackageAssets
Expand Down Expand Up @@ -332,7 +342,12 @@ jobs:
filePath: $(Build.SourcesDirectory)/.ci/test.sh
targetType: filePath
- task: PublishBuildArtifacts@1
condition: and(succeeded(), in(variables['TASK'], 'regular', 'bdist', 'swig'), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
condition: >
and(
succeeded(),
in(variables['TASK'], 'regular', 'bdist', 'swig'),
not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))
)
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: PackageAssets
Expand Down Expand Up @@ -377,7 +392,12 @@ jobs:
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/')))
condition: >
and(
succeeded(),
in(variables['TASK'], 'regular', 'bdist', 'swig'),
not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))
)
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: PackageAssets
Expand All @@ -394,6 +414,7 @@ jobs:
- script: |
git clean -d -f -x
displayName: 'Clean source directory'
# yamllint disable rule:line-length
- script: |
LGB_VER=$(head -n 1 VERSION.txt | sed "s/rc/-/g")
R_LIB_PATH=~/Rlib
Expand All @@ -402,6 +423,7 @@ jobs:
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
sh build-cran-package.sh --r-executable=RD || exit 1
mv lightgbm_${LGB_VER}.tar.gz $(Build.ArtifactStagingDirectory)/lightgbm-${LGB_VER}-r-cran.tar.gz
# yamllint enable rule:line-length
displayName: 'Build CRAN R-package'
- task: PublishBuildArtifacts@1
condition: succeeded()
Expand Down
2 changes: 1 addition & 1 deletion .yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ extends: default
rules:
document-start: disable
line-length:
max: 999 # temporarily increase allowed line length
max: 120
truthy:
# prevent treating GitHub Workflow "on" key as boolean value
check-keys: false

0 comments on commit 425395d

Please sign in to comment.