Unverified Commit 425395de authored by Nikita Titov's avatar Nikita Titov Committed by GitHub
Browse files

[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
parent 9f1af051
...@@ -43,9 +43,12 @@ jobs: ...@@ -43,9 +43,12 @@ jobs:
software-properties-common software-properties-common
# set up nvidia-docker # set up nvidia-docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - 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/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 update
sudo apt-get install --no-install-recommends -y \ sudo apt-get install --no-install-recommends -y \
containerd.io \ containerd.io \
...@@ -58,6 +61,7 @@ jobs: ...@@ -58,6 +61,7 @@ jobs:
run: | run: |
exit 0 exit 0
test: test:
# yamllint disable-line rule:line-length
name: ${{ matrix.task }} ${{ matrix.cuda_version }} ${{ matrix.method }} (${{ matrix.linux_version }}, ${{ matrix.compiler }}, Python ${{ matrix.python_version }}) name: ${{ matrix.task }} ${{ matrix.cuda_version }} ${{ matrix.method }} (${{ matrix.linux_version }}, ${{ matrix.compiler }}, Python ${{ matrix.python_version }})
runs-on: [self-hosted, linux] runs-on: [self-hosted, linux]
needs: [restart-docker] needs: [restart-docker]
......
...@@ -34,12 +34,18 @@ jobs: ...@@ -34,12 +34,18 @@ jobs:
remove-pr-labels: 'awaiting response,awaiting review,blocking,in progress' remove-pr-labels: 'awaiting response,awaiting review,blocking,in progress'
# what message should be posted prior to locking? # what message should be posted prior to locking?
issue-comment: > issue-comment: >
This issue has been automatically locked since there has not been any recent activity since it was closed. This issue has been automatically locked
To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues 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. including a reference to this.
pr-comment: > pr-comment: >
This pull request has been automatically locked since there has not been any recent activity since it was closed. This pull request has been automatically locked
To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues 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. including a reference to this.
# what should the locking status be? # what should the locking status be?
issue-lock-reason: 'resolved' issue-lock-reason: 'resolved'
......
...@@ -18,9 +18,14 @@ jobs: ...@@ -18,9 +18,14 @@ jobs:
- uses: lee-dohm/no-response@v0.5.0 - uses: lee-dohm/no-response@v0.5.0
with: with:
closeComment: > closeComment: >
This issue has been automatically closed because it has been awaiting a response for too long. This issue has been automatically closed
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. because it has been awaiting a response for too long.
If the issue has been locked for editing by the time you return to it, please open a new issue and reference this one.
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! Thank you for taking the time to improve LightGBM!
daysUntilClose: 30 daysUntilClose: 30
responseRequiredLabel: awaiting response responseRequiredLabel: awaiting response
......
...@@ -22,8 +22,11 @@ jobs: ...@@ -22,8 +22,11 @@ jobs:
) )
for i in "${workflows[@]}"; do for i in "${workflows[@]}"; do
workflow_name=${i%;*} workflow_name=${i%;*}
comment="The last reported status from workflow \"$workflow_name\" is failure."
comment+=" Commit fixes and rerun the workflow."
trigger_phrase=${i#*;} trigger_phrase=${i#*;}
python "$GITHUB_WORKSPACE/.ci/get-workflow-status.py" "$trigger_phrase" \ python \
|| { echo "The last reported status from workflow \"$workflow_name\" is failure. Commit fixes and rerun the workflow."; \ "$GITHUB_WORKSPACE/.ci/get-workflow-status.py" \
exit 1; } "$trigger_phrase" \
|| { echo "${comment}"; exit 1; }
done done
...@@ -47,6 +47,7 @@ env: ...@@ -47,6 +47,7 @@ env:
jobs: jobs:
test: test:
# yamllint disable-line rule:line-length
name: ${{ matrix.task }} (${{ matrix.os }}, ${{ matrix.compiler }}, R ${{ matrix.r_version }}, ${{ matrix.build_type }}) name: ${{ matrix.task }} (${{ matrix.os }}, ${{ matrix.compiler }}, R ${{ matrix.r_version }}, ${{ matrix.build_type }})
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
container: ${{ matrix.container }} container: ${{ matrix.container }}
...@@ -244,7 +245,9 @@ jobs: ...@@ -244,7 +245,9 @@ jobs:
- name: Install packages - name: Install packages
shell: bash shell: bash
run: | 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 }} sh build-cran-package.sh --r-executable=RD${{ matrix.r_customization }}
RD${{ matrix.r_customization }} CMD INSTALL lightgbm_*.tar.gz || exit 1 RD${{ matrix.r_customization }} CMD INSTALL lightgbm_*.tar.gz || exit 1
- name: Run tests with sanitizers - name: Run tests with sanitizers
...@@ -309,7 +312,9 @@ jobs: ...@@ -309,7 +312,9 @@ jobs:
- name: Install packages and run tests - name: Install packages and run tests
shell: bash shell: bash
run: | 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 sh build-cran-package.sh
# 'rchk' isn't run through 'R CMD check', use the approach documented at # 'rchk' isn't run through 'R CMD check', use the approach documented at
......
...@@ -33,17 +33,25 @@ jobs: ...@@ -33,17 +33,25 @@ 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 }}"
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_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}" "${comment}"
- 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 }}."
......
...@@ -63,10 +63,12 @@ jobs: ...@@ -63,10 +63,12 @@ jobs:
submodules: true submodules: true
- name: Install packages - name: Install packages
shell: bash shell: bash
# yamllint disable rule:line-length
run: | run: |
Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'roxygen2', 'testthat'), repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())" 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 sh build-cran-package.sh || exit 1
R CMD INSTALL --with-keep.source lightgbm_*.tar.gz || exit 1 R CMD INSTALL --with-keep.source lightgbm_*.tar.gz || exit 1
# yamllint enable rule:line-length
- name: Test documentation - name: Test documentation
shell: bash --noprofile --norc {0} shell: bash --noprofile --norc {0}
run: | run: |
......
...@@ -6,7 +6,10 @@ on: ...@@ -6,7 +6,10 @@ on:
jobs: jobs:
triggering-tests: 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 runs-on: ubuntu-latest
env: env:
SECRETS_WORKFLOW: ${{ secrets.WORKFLOW }} SECRETS_WORKFLOW: ${{ secrets.WORKFLOW }}
......
...@@ -137,7 +137,12 @@ jobs: ...@@ -137,7 +137,12 @@ jobs:
filePath: $(Build.SourcesDirectory)/.ci/test.sh filePath: $(Build.SourcesDirectory)/.ci/test.sh
targetType: filePath targetType: filePath
- task: PublishBuildArtifacts@1 - 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: inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)' pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: PackageAssets artifactName: PackageAssets
...@@ -279,7 +284,12 @@ jobs: ...@@ -279,7 +284,12 @@ jobs:
/bin/bash $BUILD_DIRECTORY/docker-script.sh /bin/bash $BUILD_DIRECTORY/docker-script.sh
displayName: 'Setup and run tests' displayName: 'Setup and run tests'
- task: PublishBuildArtifacts@1 - 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: inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)' pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: PackageAssets artifactName: PackageAssets
...@@ -332,7 +342,12 @@ jobs: ...@@ -332,7 +342,12 @@ jobs:
filePath: $(Build.SourcesDirectory)/.ci/test.sh filePath: $(Build.SourcesDirectory)/.ci/test.sh
targetType: filePath targetType: filePath
- task: PublishBuildArtifacts@1 - 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: inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)' pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: PackageAssets artifactName: PackageAssets
...@@ -377,7 +392,12 @@ jobs: ...@@ -377,7 +392,12 @@ jobs:
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 displayName: Test
- task: PublishBuildArtifacts@1 - 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: inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)' pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: PackageAssets artifactName: PackageAssets
...@@ -394,6 +414,7 @@ jobs: ...@@ -394,6 +414,7 @@ jobs:
- script: | - script: |
git clean -d -f -x git clean -d -f -x
displayName: 'Clean source directory' displayName: 'Clean source directory'
# yamllint disable rule:line-length
- script: | - script: |
LGB_VER=$(head -n 1 VERSION.txt | sed "s/rc/-/g") LGB_VER=$(head -n 1 VERSION.txt | sed "s/rc/-/g")
R_LIB_PATH=~/Rlib R_LIB_PATH=~/Rlib
...@@ -402,6 +423,7 @@ jobs: ...@@ -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 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 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 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' displayName: 'Build CRAN R-package'
- task: PublishBuildArtifacts@1 - task: PublishBuildArtifacts@1
condition: succeeded() condition: succeeded()
......
...@@ -4,7 +4,7 @@ extends: default ...@@ -4,7 +4,7 @@ extends: default
rules: rules:
document-start: disable document-start: disable
line-length: line-length:
max: 999 # temporarily increase allowed line length max: 120
truthy: truthy:
# prevent treating GitHub Workflow "on" key as boolean value # prevent treating GitHub Workflow "on" key as boolean value
check-keys: false check-keys: false
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