From 46d1536a364b443c5a765561403101abe40c9d41 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 03:44:21 +0300 Subject: [PATCH 01/39] Update static_analysis.yml --- .github/workflows/static_analysis.yml | 93 ++++++++++++++------------- 1 file changed, 47 insertions(+), 46 deletions(-) diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index 34e573e0eea6..f7a564fedb32 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -6,6 +6,7 @@ on: push: branches: - master + - ci/yamllint pull_request: branches: - master @@ -31,7 +32,7 @@ jobs: matrix: include: - task: lint - - task: check-docs + # - task: check-docs steps: - name: Checkout repository uses: actions/checkout@v4 @@ -47,48 +48,48 @@ jobs: export PATH=${CONDA}/bin:$HOME/.local/bin:${PATH} $GITHUB_WORKSPACE/.ci/setup.sh || exit 1 $GITHUB_WORKSPACE/.ci/test.sh || exit 1 - r-check-docs: - name: r-package-check-docs - timeout-minutes: 60 - runs-on: ubuntu-latest - container: rocker/verse - steps: - - name: Trust git cloning LightGBM - run: | - git config --global --add safe.directory "${GITHUB_WORKSPACE}" - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 5 - submodules: true - - name: Install packages - shell: bash - 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 - - name: Test documentation - shell: bash --noprofile --norc {0} - run: | - Rscript --vanilla -e "roxygen2::roxygenize('R-package/', load = 'installed')" || exit 1 - num_doc_files_changed=$( - git diff --name-only | grep --count -E "\.Rd|NAMESPACE" - ) - if [[ ${num_doc_files_changed} -gt 0 ]]; then - echo "Some R documentation files have changed. Please re-generate them and commit those changes." - echo "" - echo " sh build-cran-package.sh" - echo " R CMD INSTALL --with-keep.source lightgbm_*.tar.gz" - echo " Rscript -e \"roxygen2::roxygenize('R-package/', load = 'installed')\"" - echo "" - exit 1 - fi - all-static-analysis-jobs-successful: - if: always() - runs-on: ubuntu-latest - needs: [test, r-check-docs] - steps: - - name: Note that all tests succeeded - uses: re-actors/alls-green@v1.2.2 - with: - jobs: ${{ toJSON(needs) }} + # r-check-docs: + # name: r-package-check-docs + # timeout-minutes: 60 + # runs-on: ubuntu-latest + # container: rocker/verse + # steps: + # - name: Trust git cloning LightGBM + # run: | + # git config --global --add safe.directory "${GITHUB_WORKSPACE}" + # - name: Checkout repository + # uses: actions/checkout@v4 + # with: + # fetch-depth: 5 + # submodules: true + # - name: Install packages + # shell: bash + # 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 + # - name: Test documentation + # shell: bash --noprofile --norc {0} + # run: | + # Rscript --vanilla -e "roxygen2::roxygenize('R-package/', load = 'installed')" || exit 1 + # num_doc_files_changed=$( + # git diff --name-only | grep --count -E "\.Rd|NAMESPACE" + # ) + # if [[ ${num_doc_files_changed} -gt 0 ]]; then + # echo "Some R documentation files have changed. Please re-generate them and commit those changes." + # echo "" + # echo " sh build-cran-package.sh" + # echo " R CMD INSTALL --with-keep.source lightgbm_*.tar.gz" + # echo " Rscript -e \"roxygen2::roxygenize('R-package/', load = 'installed')\"" + # echo "" + # exit 1 + # fi + # all-static-analysis-jobs-successful: + # if: always() + # runs-on: ubuntu-latest + # needs: [test, r-check-docs] + # steps: + # - name: Note that all tests succeeded + # uses: re-actors/alls-green@v1.2.2 + # with: + # jobs: ${{ toJSON(needs) }} From 3127b53a7155f2debb789052a3598fbff04e4337 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 03:50:42 +0300 Subject: [PATCH 02/39] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 72 +++++++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 32 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b334db19b8e7..6ce79bf757c2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,36 +12,44 @@ exclude: | |R-package/man/.*Rd$ repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + # - repo: https://github.com/pre-commit/pre-commit-hooks + # rev: v5.0.0 + # hooks: + # - id: end-of-file-fixer + # - id: trailing-whitespace + - repo: https://github.com/adrienverge/yamllint + rev: 1.35.1 hooks: - - id: end-of-file-fixer - - id: trailing-whitespace - - repo: https://github.com/pycqa/isort - rev: 5.13.2 - hooks: - - id: isort - name: isort (python) - args: ["--settings-path", "python-package/pyproject.toml"] - - repo: https://github.com/astral-sh/ruff-pre-commit - # Ruff version. - rev: v0.7.0 - hooks: - # Run the linter. - - id: ruff - args: ["--config", "python-package/pyproject.toml"] - types_or: [python, jupyter] - # Run the formatter. - - id: ruff-format - args: ["--config", "python-package/pyproject.toml"] - types_or: [python, jupyter] - - repo: https://github.com/shellcheck-py/shellcheck-py - rev: v0.10.0.1 - hooks: - - id: shellcheck - - repo: https://github.com/crate-ci/typos - rev: v1.23.2 - hooks: - - id: typos - args: ["--force-exclude"] - exclude: (\.gitignore$)|(^\.editorconfig$) + - id: yamllint + args: [--strict, -c=/path/to/.yamllint] + # entry: yamllint + # language: python + # types: [file, yaml] + # - repo: https://github.com/pycqa/isort + # rev: 5.13.2 + # hooks: + # - id: isort + # name: isort (python) + # args: ["--settings-path", "python-package/pyproject.toml"] + # - repo: https://github.com/astral-sh/ruff-pre-commit + # # Ruff version. + # rev: v0.7.0 + # hooks: + # # Run the linter. + # - id: ruff + # args: ["--config", "python-package/pyproject.toml"] + # types_or: [python, jupyter] + # # Run the formatter. + # - id: ruff-format + # args: ["--config", "python-package/pyproject.toml"] + # types_or: [python, jupyter] + # - repo: https://github.com/shellcheck-py/shellcheck-py + # rev: v0.10.0.1 + # hooks: + # - id: shellcheck + # - repo: https://github.com/crate-ci/typos + # rev: v1.23.2 + # hooks: + # - id: typos + # args: ["--force-exclude"] + # exclude: (\.gitignore$)|(^\.editorconfig$) From 959aa10d7d4c7fb4d386985ff478b3504eb06fce Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 03:58:27 +0300 Subject: [PATCH 03/39] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6ce79bf757c2..d6bd248c7080 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,7 +21,7 @@ repos: rev: 1.35.1 hooks: - id: yamllint - args: [--strict, -c=/path/to/.yamllint] + args: ["--strict"] # entry: yamllint # language: python # types: [file, yaml] From fc847abd893fc74d01f59177ff7f764e31fdfbd7 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 04:02:10 +0300 Subject: [PATCH 04/39] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d6bd248c7080..88d241de3726 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,8 +17,8 @@ repos: # hooks: # - id: end-of-file-fixer # - id: trailing-whitespace - - repo: https://github.com/adrienverge/yamllint - rev: 1.35.1 + - repo: https://github.com/adrienverge/yamllint.git + rev: v1.29.0 hooks: - id: yamllint args: ["--strict"] From d8eed0ed341345bbeaf1fc269b4de580b20b2092 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 04:05:33 +0300 Subject: [PATCH 05/39] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 88d241de3726..cdea5037bf76 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,7 +17,7 @@ repos: # hooks: # - id: end-of-file-fixer # - id: trailing-whitespace - - repo: https://github.com/adrienverge/yamllint.git + - repo: https://github.com/adrienverge/yamllint rev: v1.29.0 hooks: - id: yamllint From 58bd0f201858555cbbec8c3ae21149f83211db2a Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 04:17:54 +0300 Subject: [PATCH 06/39] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cdea5037bf76..7c5d3791debb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: # - id: end-of-file-fixer # - id: trailing-whitespace - repo: https://github.com/adrienverge/yamllint - rev: v1.29.0 + rev: v1.32.0 hooks: - id: yamllint args: ["--strict"] From df67352d647ef99fe748ee3a2c22e2a0c033d7a7 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 04:19:43 +0300 Subject: [PATCH 07/39] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7c5d3791debb..c6e0a4b640c4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: # - id: end-of-file-fixer # - id: trailing-whitespace - repo: https://github.com/adrienverge/yamllint - rev: v1.32.0 + rev: v1.33.0 hooks: - id: yamllint args: ["--strict"] From 7256a4d5010d170bbca5433e33a8992db0890e34 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 04:21:51 +0300 Subject: [PATCH 08/39] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c6e0a4b640c4..ae1287999340 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,13 +18,10 @@ repos: # - id: end-of-file-fixer # - id: trailing-whitespace - repo: https://github.com/adrienverge/yamllint - rev: v1.33.0 + rev: v1.34.0 hooks: - id: yamllint args: ["--strict"] - # entry: yamllint - # language: python - # types: [file, yaml] # - repo: https://github.com/pycqa/isort # rev: 5.13.2 # hooks: From bd7dc232337cf98021cc4d610d851339d53af5aa Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 04:23:47 +0300 Subject: [PATCH 09/39] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ae1287999340..a5d3f290314c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: # - id: end-of-file-fixer # - id: trailing-whitespace - repo: https://github.com/adrienverge/yamllint - rev: v1.34.0 + rev: v1.35.0 hooks: - id: yamllint args: ["--strict"] From 4b55c65664438b3f187b3174eaeb6c95dbbda1d6 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 04:26:29 +0300 Subject: [PATCH 10/39] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a5d3f290314c..5d10660b6f9a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: # - id: end-of-file-fixer # - id: trailing-whitespace - repo: https://github.com/adrienverge/yamllint - rev: v1.35.0 + rev: v1.35.1 hooks: - id: yamllint args: ["--strict"] From e166ff99d2a9e47c4ebecb8c9d010d31427e1faa Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 04:35:13 +0300 Subject: [PATCH 11/39] Create .yamllint.yml --- .yamllint.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .yamllint.yml diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 000000000000..c6c0a3f08b54 --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,4 @@ +extends: default + +rules: + document-start: disable From 200f9108d1c8a2ac7ceabe4f588de0118222ce66 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 04:52:09 +0300 Subject: [PATCH 12/39] Update .yamllint.yml --- .yamllint.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.yamllint.yml b/.yamllint.yml index c6c0a3f08b54..809874368d8a 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -2,3 +2,5 @@ extends: default rules: document-start: disable + line-length: + max: 120 From efe3a17252d618e3ef10d2d82771a62be439f7c8 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 05:03:16 +0300 Subject: [PATCH 13/39] Update .yamllint.yml --- .yamllint.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.yamllint.yml b/.yamllint.yml index 809874368d8a..788f5db85013 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -4,3 +4,6 @@ rules: document-start: disable line-length: max: 120 + truthy: + # prevent treating GitHub Workflow "on" key as boolean value + check-keys: false From 038b0676ceda47ed05fa1a7ab4cf1246f8db0ea6 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 05:04:22 +0300 Subject: [PATCH 14/39] Update .yamllint.yml --- .yamllint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.yamllint.yml b/.yamllint.yml index 788f5db85013..7bb0ae95ec74 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -1,3 +1,4 @@ +# default config: https://yamllint.readthedocs.io/en/stable/configuration.html#default-configuration extends: default rules: From a83a5c6de9254d0a43bc713f043c005a60fd6a9d Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 05:13:37 +0300 Subject: [PATCH 15/39] Update .yamllint.yml --- .yamllint.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.yamllint.yml b/.yamllint.yml index 7bb0ae95ec74..54ec35c2360d 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -5,6 +5,8 @@ rules: document-start: disable line-length: max: 120 + allow-non-breakable-words: true + allow-non-breakable-inline-mappings: true truthy: # prevent treating GitHub Workflow "on" key as boolean value check-keys: false From 23a021b9802b91a289ed352428a047ef8daf5cbc Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 05:45:37 +0300 Subject: [PATCH 16/39] Update lock.yml --- .github/workflows/lock.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 195fd5f1c8f1..7265e97bad07 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -32,12 +32,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' From eb5c2b19099b00621270d87c650a389fc8651965 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 05:45:56 +0300 Subject: [PATCH 17/39] Update .yamllint.yml --- .yamllint.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.yamllint.yml b/.yamllint.yml index 54ec35c2360d..7bb0ae95ec74 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -5,8 +5,6 @@ rules: document-start: disable line-length: max: 120 - allow-non-breakable-words: true - allow-non-breakable-inline-mappings: true truthy: # prevent treating GitHub Workflow "on" key as boolean value check-keys: false From 9970292635fc6aa5c4bbd26d78430cac46544ffc Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 05:48:13 +0300 Subject: [PATCH 18/39] Update lock.yml --- .github/workflows/lock.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 7265e97bad07..2552f022c32e 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -34,14 +34,14 @@ jobs: 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 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 including a reference to this. From c25e46c1f5f80d3787cfb360aacea7078897c431 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 05:56:31 +0300 Subject: [PATCH 19/39] Update triggering_comments.yml --- .github/workflows/triggering_comments.yml | 43 ++++++++++++----------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/.github/workflows/triggering_comments.yml b/.github/workflows/triggering_comments.yml index be33a0e81bf9..452d487c42e5 100644 --- a/.github/workflows/triggering_comments.yml +++ b/.github/workflows/triggering_comments.yml @@ -6,29 +6,32 @@ 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 }} steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 5 - submodules: false + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 5 + submodules: false - - name: Trigger R valgrind tests - if: github.event.comment.body == '/gha run r-valgrind' - run: | - $GITHUB_WORKSPACE/.ci/trigger-dispatch-run.sh \ - "${{ github.event.issue.pull_request.url }}" \ - "${{ github.event.comment.id }}" \ - "gha_run_r_valgrind" + - name: Trigger R valgrind tests + if: github.event.comment.body == '/gha run r-valgrind' + run: | + $GITHUB_WORKSPACE/.ci/trigger-dispatch-run.sh \ + "${{ github.event.issue.pull_request.url }}" \ + "${{ github.event.comment.id }}" \ + "gha_run_r_valgrind" - - name: Trigger update R configure - if: github.event.comment.body == '/gha run r-configure' - run: | - $GITHUB_WORKSPACE/.ci/trigger-dispatch-run.sh \ - "${{ github.event.issue.pull_request.url }}" \ - "${{ github.event.comment.id }}" \ - "gha_run_r_configure" + - name: Trigger update R configure + if: github.event.comment.body == '/gha run r-configure' + run: | + $GITHUB_WORKSPACE/.ci/trigger-dispatch-run.sh \ + "${{ github.event.issue.pull_request.url }}" \ + "${{ github.event.comment.id }}" \ + "gha_run_r_configure" From f62cc0e1463e363e897ab21f4ea66f471ebc7b23 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 06:08:23 +0300 Subject: [PATCH 20/39] Update static_analysis.yml --- .github/workflows/static_analysis.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index f7a564fedb32..58845b60391c 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -5,11 +5,11 @@ name: Static Analysis on: push: branches: - - master - - ci/yamllint + - master + - ci/yamllint pull_request: branches: - - master + - master # automatically cancel in-progress builds if another commit is pushed concurrency: @@ -65,7 +65,8 @@ jobs: # - name: Install packages # shell: bash # run: | - # Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'roxygen2', 'testthat'), repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())" + # packages="'R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'roxygen2', 'testthat'" + # Rscript -e "install.packages(c(${packages}), 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 # - name: Test documentation From 83e943ccb858079da995b88f00efa25094d8f120 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 06:14:21 +0300 Subject: [PATCH 21/39] Update static_analysis.yml --- .github/workflows/static_analysis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index 58845b60391c..477668be6ea0 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -65,8 +65,9 @@ jobs: # - name: Install packages # shell: bash # run: | - # packages="'R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'roxygen2', 'testthat'" - # Rscript -e "install.packages(c(${packages}), repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())" + # PACKS="'R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'roxygen2', 'testthat'" + # CRAN_MIRROR="https://cran.rstudio.com" + # Rscript -e "install.packages(c(${PACKS}), repos = '${CRAN_MIRROR}', Ncpus = parallel::detectCores())" # sh build-cran-package.sh || exit 1 # R CMD INSTALL --with-keep.source lightgbm_*.tar.gz || exit 1 # - name: Test documentation From e0350b5a7d73e13f3d2094440019ec9e58e08452 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 06:16:00 +0300 Subject: [PATCH 22/39] Update static_analysis.yml --- .github/workflows/static_analysis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index 477668be6ea0..e03507c7a326 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -62,11 +62,11 @@ jobs: # with: # fetch-depth: 5 # submodules: true - # - name: Install packages - # shell: bash - # run: | - # PACKS="'R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'roxygen2', 'testthat'" - # CRAN_MIRROR="https://cran.rstudio.com" + # - name: Install packages + # shell: bash + # run: | + # R_LIBS="'R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'roxygen2', 'testthat'" + # CRAN_MIRROR="https://cran.rstudio.com" # Rscript -e "install.packages(c(${PACKS}), repos = '${CRAN_MIRROR}', Ncpus = parallel::detectCores())" # sh build-cran-package.sh || exit 1 # R CMD INSTALL --with-keep.source lightgbm_*.tar.gz || exit 1 From b91f37291562bcbce838b0f81c73f3804910f276 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 06:17:51 +0300 Subject: [PATCH 23/39] Update r_valgrind.yml --- .github/workflows/r_valgrind.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/r_valgrind.yml b/.github/workflows/r_valgrind.yml index 8593831eed56..9b3b6c9891be 100644 --- a/.github/workflows/r_valgrind.yml +++ b/.github/workflows/r_valgrind.yml @@ -33,7 +33,10 @@ 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 }}" $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}" @@ -43,7 +46,10 @@ jobs: - 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 }}." From 16d3849b36393a85c51361b1a500add90e870a13 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 06:18:50 +0300 Subject: [PATCH 24/39] Update python_package.yml --- .github/workflows/python_package.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python_package.yml b/.github/workflows/python_package.yml index acc40026f9b8..154baf67b7ee 100644 --- a/.github/workflows/python_package.yml +++ b/.github/workflows/python_package.yml @@ -3,10 +3,10 @@ name: Python-package on: push: branches: - - master + - master pull_request: branches: - - master + - master # automatically cancel in-progress builds if another commit is pushed concurrency: @@ -147,7 +147,7 @@ jobs: runs-on: ubuntu-latest needs: [test, test-latest-versions, test-oldest-versions] steps: - - name: Note that all tests succeeded - uses: re-actors/alls-green@v1.2.2 - with: - jobs: ${{ toJSON(needs) }} + - name: Note that all tests succeeded + uses: re-actors/alls-green@v1.2.2 + with: + jobs: ${{ toJSON(needs) }} From 022948fc42eb5147ecf71d5e27a93ba7334c2046 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 06:31:32 +0300 Subject: [PATCH 25/39] Update cuda.yml --- .github/workflows/cuda.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cuda.yml b/.github/workflows/cuda.yml index f6bb354bc5a9..e73ddae35823 100644 --- a/.github/workflows/cuda.yml +++ b/.github/workflows/cuda.yml @@ -3,10 +3,10 @@ name: CUDA Version on: push: branches: - - master + - master pull_request: branches: - - master + - master # Run manually by clicking a button in the UI workflow_dispatch: inputs: @@ -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 \ @@ -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] @@ -130,7 +134,7 @@ jobs: runs-on: ubuntu-latest needs: [test] steps: - - name: Note that all tests succeeded - uses: re-actors/alls-green@v1.2.2 - with: - jobs: ${{ toJSON(needs) }} + - name: Note that all tests succeeded + uses: re-actors/alls-green@v1.2.2 + with: + jobs: ${{ toJSON(needs) }} From ca5bf6fc55df2235e29eb77fb62b7cd35623bc9e Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 06:36:32 +0300 Subject: [PATCH 26/39] Update optional_checks.yml --- .github/workflows/optional_checks.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/optional_checks.yml b/.github/workflows/optional_checks.yml index f794c38e770c..702ec99ad51a 100644 --- a/.github/workflows/optional_checks.yml +++ b/.github/workflows/optional_checks.yml @@ -22,8 +22,9 @@ 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; } + || { echo ${comment}; exit 1; } done From 24e97e812e86e45c288b7232883454abff36c412 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 06:42:16 +0300 Subject: [PATCH 27/39] Update r_package.yml --- .github/workflows/r_package.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/r_package.yml b/.github/workflows/r_package.yml index 66e05a18ba1f..fc7c004bf144 100644 --- a/.github/workflows/r_package.yml +++ b/.github/workflows/r_package.yml @@ -3,10 +3,10 @@ name: R-package on: push: branches: - - master + - master pull_request: branches: - - master + - master # automatically cancel in-progress builds if another commit is pushed concurrency: @@ -33,6 +33,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 }} @@ -230,7 +231,10 @@ 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="'R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'testthat'" + CRAN_MIRROR="https://cran.rstudio.com" + RDscript${{ matrix.r_customization }} \ + -e "install.packages(c(${R_LIBS}), repos = '${CRAN_MIRROR}', 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 @@ -295,7 +299,10 @@ 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="'R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl'" + CRAN_MIRROR="https://cran.rstudio.com" + Rscript \ + -e "install.packages(c(${R_LIBS}), repos = '${CRAN_MIRROR}', Ncpus = parallel::detectCores())" sh build-cran-package.sh # 'rchk' isn't run through 'R CMD check', use the approach documented at @@ -344,7 +351,7 @@ jobs: runs-on: ubuntu-latest needs: [test, test-r-sanitizers, test-r-extra-checks] steps: - - name: Note that all tests succeeded - uses: re-actors/alls-green@v1.2.2 - with: - jobs: ${{ toJSON(needs) }} + - name: Note that all tests succeeded + uses: re-actors/alls-green@v1.2.2 + with: + jobs: ${{ toJSON(needs) }} From a71678b37fa97be3821df1cf237b10203efa989d Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 06:43:21 +0300 Subject: [PATCH 28/39] Update no-response.yml --- .github/workflows/no-response.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/no-response.yml b/.github/workflows/no-response.yml index 051d44fba20c..65c226978ee9 100644 --- a/.github/workflows/no-response.yml +++ b/.github/workflows/no-response.yml @@ -18,9 +18,14 @@ jobs: - uses: lee-dohm/no-response@v0.5.0 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 From 32c5f2dc7bab687d5322ddea3757be307294bc30 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 06:45:36 +0300 Subject: [PATCH 29/39] Update _pkgdown.yml --- R-package/pkgdown/_pkgdown.yml | 92 +++++++++++++++++----------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/R-package/pkgdown/_pkgdown.yml b/R-package/pkgdown/_pkgdown.yml index c2d6718a2926..258a27a2ea31 100644 --- a/R-package/pkgdown/_pkgdown.yml +++ b/R-package/pkgdown/_pkgdown.yml @@ -37,70 +37,70 @@ navbar: title: LightGBM type: default left: - - icon: fa-reply fa-lg - href: ../ - - icon: fa-home fa-lg - href: index.html - - text: Articles - href: articles/index.html - - text: Reference - href: reference/index.html + - icon: fa-reply fa-lg + href: ../ + - icon: fa-home fa-lg + href: index.html + - text: Articles + href: articles/index.html + - text: Reference + href: reference/index.html right: - - icon: fa-github fa-lg - href: https://github.com/microsoft/LightGBM/tree/master/R-package + - icon: fa-github fa-lg + href: https://github.com/microsoft/LightGBM/tree/master/R-package reference: - title: Datasets desc: Datasets included with the R-package contents: - - '`agaricus.train`' - - '`agaricus.test`' - - '`bank`' + - '`agaricus.train`' + - '`agaricus.test`' + - '`bank`' - title: Data Input / Output desc: Data I/O required for LightGBM contents: - - '`dim.lgb.Dataset`' - - '`dimnames.lgb.Dataset`' - - '`get_field`' - - '`set_field`' - - '`lgb.Dataset`' - - '`lgb.Dataset.construct`' - - '`lgb.Dataset.create.valid`' - - '`lgb.Dataset.save`' - - '`lgb.Dataset.set.categorical`' - - '`lgb.Dataset.set.reference`' - - '`lgb.convert_with_rules`' - - '`lgb.slice.Dataset`' + - '`dim.lgb.Dataset`' + - '`dimnames.lgb.Dataset`' + - '`get_field`' + - '`set_field`' + - '`lgb.Dataset`' + - '`lgb.Dataset.construct`' + - '`lgb.Dataset.create.valid`' + - '`lgb.Dataset.save`' + - '`lgb.Dataset.set.categorical`' + - '`lgb.Dataset.set.reference`' + - '`lgb.convert_with_rules`' + - '`lgb.slice.Dataset`' - title: Machine Learning desc: Train models with LightGBM and then use them to make predictions on new data contents: - - '`lightgbm`' - - '`lgb.train`' - - '`predict.lgb.Booster`' - - '`lgb.cv`' - - '`lgb.configure_fast_predict`' + - '`lightgbm`' + - '`lgb.train`' + - '`predict.lgb.Booster`' + - '`lgb.cv`' + - '`lgb.configure_fast_predict`' - title: Saving / Loading Models desc: Save and load LightGBM models contents: - - '`lgb.dump`' - - '`lgb.save`' - - '`lgb.load`' - - '`lgb.model.dt.tree`' - - '`lgb.drop_serialized`' - - '`lgb.make_serializable`' - - '`lgb.restore_handle`' + - '`lgb.dump`' + - '`lgb.save`' + - '`lgb.load`' + - '`lgb.model.dt.tree`' + - '`lgb.drop_serialized`' + - '`lgb.make_serializable`' + - '`lgb.restore_handle`' - title: Model Interpretation desc: Analyze your models contents: - - '`lgb.get.eval.result`' - - '`lgb.importance`' - - '`lgb.interprete`' - - '`lgb.plot.importance`' - - '`lgb.plot.interpretation`' - - '`print.lgb.Booster`' - - '`summary.lgb.Booster`' + - '`lgb.get.eval.result`' + - '`lgb.importance`' + - '`lgb.interprete`' + - '`lgb.plot.importance`' + - '`lgb.plot.interpretation`' + - '`print.lgb.Booster`' + - '`summary.lgb.Booster`' - title: Multithreading Control desc: Manage degree of parallelism used by LightGBM contents: - - '`getLGBMThreads`' - - '`setLGBMThreads`' + - '`getLGBMThreads`' + - '`setLGBMThreads`' From b1611c4068e5887f0f39b95420813944d6db11b4 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 06:59:32 +0300 Subject: [PATCH 30/39] Update r_valgrind.yml --- .github/workflows/r_valgrind.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/r_valgrind.yml b/.github/workflows/r_valgrind.yml index 9b3b6c9891be..961fe20942cb 100644 --- a/.github/workflows/r_valgrind.yml +++ b/.github/workflows/r_valgrind.yml @@ -37,9 +37,11 @@ jobs: "${{ 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 From b469bdb698ef31c3143c662e0babf02a3a5dafed Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 07:03:14 +0300 Subject: [PATCH 31/39] Update .vsts-ci.yml --- .vsts-ci.yml | 908 +++++++++++++++++++++++++-------------------------- 1 file changed, 454 insertions(+), 454 deletions(-) diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 3a111e10898e..1a0159de41d2 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -1,12 +1,12 @@ trigger: branches: include: - - master + - master tags: include: - - v* + - v* pr: -- master + - master variables: AZURE: 'true' CMAKE_BUILD_PARALLEL_LEVEL: 4 @@ -26,456 +26,456 @@ resources: # to minimize the risk of side effects from one run affecting future runs. # ref: https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/resources-containers-container containers: - - container: linux-artifact-builder - image: lightgbm/vsts-agent:manylinux_2_28_x86_64 - mountReadOnly: - work: false - externals: true - tools: true - tasks: true - - container: ubuntu-latest - image: 'ubuntu:22.04' - options: "--name ci-container -v /usr/bin/docker:/tmp/docker:ro" - mountReadOnly: - work: false - externals: true - tools: true - tasks: true - - container: rbase - image: wch1/r-debug - mountReadOnly: - work: false - externals: true - tools: true - tasks: true + - container: linux-artifact-builder + image: lightgbm/vsts-agent:manylinux_2_28_x86_64 + mountReadOnly: + work: false + externals: true + tools: true + tasks: true + - container: ubuntu-latest + image: 'ubuntu:22.04' + options: "--name ci-container -v /usr/bin/docker:/tmp/docker:ro" + mountReadOnly: + work: false + externals: true + tools: true + tasks: true + - container: rbase + image: wch1/r-debug + mountReadOnly: + work: false + externals: true + tools: true + tasks: true jobs: -########################################### -- job: Maintenance -########################################### - pool: mariner-20240410-0 - container: ubuntu-latest - # routine maintenance (like periodically deleting old files), - # to be run on 1 random CI runner in the self-hosted pool each runner - steps: - - script: | - print-diagnostics(){ - echo "---- df -h -m ----" - df -h -m - echo "---- docker system df ----" - /tmp/docker system df - echo "---- docker images ----" - /tmp/docker images - } - # check disk usage - print-diagnostics - # remove old containers, container images, volumes - # ref: https://stackoverflow.com/a/32723127/3986677) - echo "---- running 'docker system prune' ----" - /tmp/docker system prune \ - --all \ - --force \ - --filter until=720h - # check disk usage again - print-diagnostics - displayName: clean -########################################### -- job: Linux -########################################### - variables: - COMPILER: gcc - SETUP_CONDA: 'false' - OS_NAME: 'linux' - PRODUCES_ARTIFACTS: 'true' - pool: mariner-20240410-0 - container: linux-artifact-builder - strategy: - matrix: - regular: - TASK: regular - PYTHON_VERSION: '3.10' - sdist: - TASK: sdist - PYTHON_VERSION: '3.8' - bdist: - TASK: bdist - PYTHON_VERSION: '3.9' - inference: - TASK: if-else - mpi_source: - TASK: mpi - METHOD: source - PYTHON_VERSION: '3.9' - gpu_source: - TASK: gpu - METHOD: source - swig: - TASK: swig - steps: - - script: | - echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" - echo "##vso[task.prependpath]/usr/lib64/openmpi/bin" - echo "##vso[task.prependpath]$CONDA/bin" - displayName: 'Set variables' - - script: | - git clean -d -f -x - displayName: 'Clean source directory' - - script: | - echo '$(Build.SourceVersion)' > '$(Build.ArtifactStagingDirectory)/commit.txt' - displayName: 'Add commit hash to artifacts archive' - - task: Bash@3 - displayName: Setup - inputs: - filePath: $(Build.SourcesDirectory)/.ci/setup.sh - targetType: filePath - - task: Bash@3 - displayName: Test - inputs: - 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/'))) - inputs: - pathtoPublish: '$(Build.ArtifactStagingDirectory)' - artifactName: PackageAssets - artifactType: container -########################################### -- job: Linux_latest -########################################### - variables: - COMPILER: clang-17 - DEBIAN_FRONTEND: 'noninteractive' - IN_UBUNTU_BASE_CONTAINER: 'true' - OS_NAME: 'linux' - SETUP_CONDA: 'true' - pool: mariner-20240410-0 - container: ubuntu-latest - strategy: - matrix: - regular: - TASK: regular - sdist: - TASK: sdist - bdist: - TASK: bdist - PYTHON_VERSION: '3.10' - inference: - TASK: if-else - mpi_source: - TASK: mpi - METHOD: source - mpi_pip: - TASK: mpi - METHOD: pip - PYTHON_VERSION: '3.11' - mpi_wheel: - TASK: mpi - METHOD: wheel - PYTHON_VERSION: '3.9' - gpu_source: - TASK: gpu - METHOD: source - PYTHON_VERSION: '3.11' - gpu_pip: - TASK: gpu - METHOD: pip - PYTHON_VERSION: '3.10' - gpu_wheel: - TASK: gpu - METHOD: wheel - PYTHON_VERSION: '3.9' - cpp_tests: - TASK: cpp-tests - METHOD: with-sanitizers - steps: - - script: | - echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" - CONDA=$HOME/miniforge - echo "##vso[task.setvariable variable=CONDA]$CONDA" - echo "##vso[task.prependpath]$CONDA/bin" - displayName: 'Set variables' - # https://github.com/microsoft/azure-pipelines-agent/issues/2043#issuecomment-687983301 - - script: | - /tmp/docker exec -t -u 0 ci-container \ - sh -c "apt-get update && apt-get -o Dpkg::Options::="--force-confold" -y install sudo" - displayName: 'Install sudo' - - script: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends git - git clean -d -f -x - displayName: 'Clean source directory' - - task: Bash@3 - displayName: Setup - inputs: - filePath: $(Build.SourcesDirectory)/.ci/setup.sh - targetType: 'filePath' - - task: Bash@3 - displayName: Test - inputs: - filePath: $(Build.SourcesDirectory)/.ci/test.sh - targetType: 'filePath' -########################################### -- job: QEMU_multiarch -########################################### - variables: - BUILD_DIRECTORY: /LightGBM - COMPILER: gcc - PRODUCES_ARTIFACTS: 'true' - pool: - vmImage: ubuntu-22.04 - timeoutInMinutes: 180 - strategy: - matrix: - bdist: - TASK: bdist - ARCH: aarch64 - steps: - - script: | - sudo apt-get update - sudo apt-get install --no-install-recommends -y \ - binfmt-support \ - qemu \ - qemu-user \ - qemu-user-static - displayName: 'Install QEMU' - - script: | - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - displayName: 'Enable Docker multi-architecture support' - - script: | - git clean -d -f -x - displayName: 'Clean source directory' - - script: | - cat > docker-script.sh < '$(Build.ArtifactStagingDirectory)/commit.txt' + displayName: 'Add commit hash to artifacts archive' + - task: Bash@3 + displayName: Setup + inputs: + filePath: $(Build.SourcesDirectory)/.ci/setup.sh + targetType: filePath + - task: Bash@3 + displayName: Test + inputs: + 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/'))) + inputs: + pathtoPublish: '$(Build.ArtifactStagingDirectory)' + artifactName: PackageAssets + artifactType: container + ########################################### + - job: Linux_latest + ########################################### + variables: + COMPILER: clang-17 + DEBIAN_FRONTEND: 'noninteractive' + IN_UBUNTU_BASE_CONTAINER: 'true' + OS_NAME: 'linux' + SETUP_CONDA: 'true' + pool: mariner-20240410-0 + container: ubuntu-latest + strategy: + matrix: + regular: + TASK: regular + sdist: + TASK: sdist + bdist: + TASK: bdist + PYTHON_VERSION: '3.10' + inference: + TASK: if-else + mpi_source: + TASK: mpi + METHOD: source + mpi_pip: + TASK: mpi + METHOD: pip + PYTHON_VERSION: '3.11' + mpi_wheel: + TASK: mpi + METHOD: wheel + PYTHON_VERSION: '3.9' + gpu_source: + TASK: gpu + METHOD: source + PYTHON_VERSION: '3.11' + gpu_pip: + TASK: gpu + METHOD: pip + PYTHON_VERSION: '3.10' + gpu_wheel: + TASK: gpu + METHOD: wheel + PYTHON_VERSION: '3.9' + cpp_tests: + TASK: cpp-tests + METHOD: with-sanitizers + steps: + - script: | + echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" + CONDA=$HOME/miniforge + echo "##vso[task.setvariable variable=CONDA]$CONDA" + echo "##vso[task.prependpath]$CONDA/bin" + displayName: 'Set variables' + # https://github.com/microsoft/azure-pipelines-agent/issues/2043#issuecomment-687983301 + - script: | + /tmp/docker exec -t -u 0 ci-container \ + sh -c "apt-get update && apt-get -o Dpkg::Options::="--force-confold" -y install sudo" + displayName: 'Install sudo' + - script: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends git + git clean -d -f -x + displayName: 'Clean source directory' + - task: Bash@3 + displayName: Setup + inputs: + filePath: $(Build.SourcesDirectory)/.ci/setup.sh + targetType: 'filePath' + - task: Bash@3 + displayName: Test + inputs: + filePath: $(Build.SourcesDirectory)/.ci/test.sh + targetType: 'filePath' + ########################################### + - job: QEMU_multiarch + ########################################### + variables: + BUILD_DIRECTORY: /LightGBM + COMPILER: gcc + PRODUCES_ARTIFACTS: 'true' + pool: + vmImage: ubuntu-22.04 + timeoutInMinutes: 180 + strategy: + matrix: + bdist: + TASK: bdist + ARCH: aarch64 + steps: + - script: | + sudo apt-get update + sudo apt-get install --no-install-recommends -y \ + binfmt-support \ + qemu \ + qemu-user \ + qemu-user-static + displayName: 'Install QEMU' + - script: | + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + displayName: 'Enable Docker multi-architecture support' + - script: | + git clean -d -f -x + displayName: 'Clean source directory' + - script: | + cat > docker-script.sh < Date: Sun, 15 Dec 2024 07:09:06 +0300 Subject: [PATCH 32/39] Update .vsts-ci.yml --- .vsts-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 1a0159de41d2..de1612c977f9 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -49,9 +49,9 @@ resources: tools: true tasks: true jobs: - ########################################### + ########################################### - job: Maintenance - ########################################### + ########################################### pool: mariner-20240410-0 container: ubuntu-latest # routine maintenance (like periodically deleting old files), From 64470039a65f5a18642a3d35230ade27c75e802f Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 07:13:41 +0300 Subject: [PATCH 33/39] Update .vsts-ci.yml --- .vsts-ci.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.vsts-ci.yml b/.vsts-ci.yml index de1612c977f9..22e6bd3b473b 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -48,8 +48,8 @@ resources: externals: true tools: true tasks: true + jobs: - ########################################### - job: Maintenance ########################################### pool: mariner-20240410-0 @@ -78,9 +78,9 @@ jobs: # check disk usage again print-diagnostics displayName: clean - ########################################### + - job: Linux - ########################################### + ########################################### variables: COMPILER: gcc SETUP_CONDA: 'false' @@ -138,9 +138,9 @@ jobs: pathtoPublish: '$(Build.ArtifactStagingDirectory)' artifactName: PackageAssets artifactType: container - ########################################### + - job: Linux_latest - ########################################### + ########################################### variables: COMPILER: clang-17 DEBIAN_FRONTEND: 'noninteractive' @@ -213,9 +213,9 @@ jobs: inputs: filePath: $(Build.SourcesDirectory)/.ci/test.sh targetType: 'filePath' - ########################################### + - job: QEMU_multiarch - ########################################### + ########################################### variables: BUILD_DIRECTORY: /LightGBM COMPILER: gcc @@ -278,9 +278,9 @@ jobs: pathtoPublish: '$(Build.ArtifactStagingDirectory)' artifactName: PackageAssets artifactType: container - ########################################### + - job: macOS - ########################################### + ########################################### variables: COMPILER: clang OS_NAME: 'macos' @@ -330,9 +330,9 @@ jobs: pathtoPublish: '$(Build.ArtifactStagingDirectory)' artifactName: PackageAssets artifactType: container - ########################################### + - job: Windows - ########################################### + ########################################### pool: vmImage: 'windows-2019' strategy: @@ -374,9 +374,9 @@ jobs: pathtoPublish: '$(Build.ArtifactStagingDirectory)' artifactName: PackageAssets artifactType: container - ########################################### + - job: R_artifact - ########################################### + ########################################### condition: not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')) pool: vmImage: 'ubuntu-22.04' @@ -401,9 +401,9 @@ jobs: artifactName: R-package artifactType: container - ########################################### + - job: Package - ########################################### + ########################################### dependsOn: - Linux - Linux_latest From fc709d1e4c8b147e3e9d9a565e9aa7202e21f6fe Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 07:21:30 +0300 Subject: [PATCH 34/39] Update .vsts-ci.yml --- .vsts-ci.yml | 522 +++++++++++++++++++++++++-------------------------- 1 file changed, 261 insertions(+), 261 deletions(-) diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 22e6bd3b473b..1867ca5f2a0c 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -57,27 +57,27 @@ jobs: # routine maintenance (like periodically deleting old files), # to be run on 1 random CI runner in the self-hosted pool each runner steps: - - script: | - print-diagnostics(){ - echo "---- df -h -m ----" - df -h -m - echo "---- docker system df ----" - /tmp/docker system df - echo "---- docker images ----" - /tmp/docker images - } - # check disk usage - print-diagnostics - # remove old containers, container images, volumes - # ref: https://stackoverflow.com/a/32723127/3986677) - echo "---- running 'docker system prune' ----" - /tmp/docker system prune \ - --all \ - --force \ - --filter until=720h - # check disk usage again - print-diagnostics - displayName: clean + - script: | + print-diagnostics(){ + echo "---- df -h -m ----" + df -h -m + echo "---- docker system df ----" + /tmp/docker system df + echo "---- docker images ----" + /tmp/docker images + } + # check disk usage + print-diagnostics + # remove old containers, container images, volumes + # ref: https://stackoverflow.com/a/32723127/3986677) + echo "---- running 'docker system prune' ----" + /tmp/docker system prune \ + --all \ + --force \ + --filter until=720h + # check disk usage again + print-diagnostics + displayName: clean - job: Linux ########################################### @@ -111,33 +111,33 @@ jobs: swig: TASK: swig steps: - - script: | - echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" - echo "##vso[task.prependpath]/usr/lib64/openmpi/bin" - echo "##vso[task.prependpath]$CONDA/bin" - displayName: 'Set variables' - - script: | - git clean -d -f -x - displayName: 'Clean source directory' - - script: | - echo '$(Build.SourceVersion)' > '$(Build.ArtifactStagingDirectory)/commit.txt' - displayName: 'Add commit hash to artifacts archive' - - task: Bash@3 - displayName: Setup - inputs: - filePath: $(Build.SourcesDirectory)/.ci/setup.sh - targetType: filePath - - task: Bash@3 - displayName: Test - inputs: - 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/'))) - inputs: - pathtoPublish: '$(Build.ArtifactStagingDirectory)' - artifactName: PackageAssets - artifactType: container + - script: | + echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" + echo "##vso[task.prependpath]/usr/lib64/openmpi/bin" + echo "##vso[task.prependpath]$CONDA/bin" + displayName: 'Set variables' + - script: | + git clean -d -f -x + displayName: 'Clean source directory' + - script: | + echo '$(Build.SourceVersion)' > '$(Build.ArtifactStagingDirectory)/commit.txt' + displayName: 'Add commit hash to artifacts archive' + - task: Bash@3 + displayName: Setup + inputs: + filePath: $(Build.SourcesDirectory)/.ci/setup.sh + targetType: filePath + - task: Bash@3 + displayName: Test + inputs: + 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/'))) + inputs: + pathtoPublish: '$(Build.ArtifactStagingDirectory)' + artifactName: PackageAssets + artifactType: container - job: Linux_latest ########################################### @@ -187,32 +187,32 @@ jobs: TASK: cpp-tests METHOD: with-sanitizers steps: - - script: | - echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" - CONDA=$HOME/miniforge - echo "##vso[task.setvariable variable=CONDA]$CONDA" - echo "##vso[task.prependpath]$CONDA/bin" - displayName: 'Set variables' - # https://github.com/microsoft/azure-pipelines-agent/issues/2043#issuecomment-687983301 - - script: | - /tmp/docker exec -t -u 0 ci-container \ - sh -c "apt-get update && apt-get -o Dpkg::Options::="--force-confold" -y install sudo" - displayName: 'Install sudo' - - script: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends git - git clean -d -f -x - displayName: 'Clean source directory' - - task: Bash@3 - displayName: Setup - inputs: - filePath: $(Build.SourcesDirectory)/.ci/setup.sh - targetType: 'filePath' - - task: Bash@3 - displayName: Test - inputs: - filePath: $(Build.SourcesDirectory)/.ci/test.sh - targetType: 'filePath' + - script: | + echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" + CONDA=$HOME/miniforge + echo "##vso[task.setvariable variable=CONDA]$CONDA" + echo "##vso[task.prependpath]$CONDA/bin" + displayName: 'Set variables' + # https://github.com/microsoft/azure-pipelines-agent/issues/2043#issuecomment-687983301 + - script: | + /tmp/docker exec -t -u 0 ci-container \ + sh -c "apt-get update && apt-get -o Dpkg::Options::="--force-confold" -y install sudo" + displayName: 'Install sudo' + - script: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends git + git clean -d -f -x + displayName: 'Clean source directory' + - task: Bash@3 + displayName: Setup + inputs: + filePath: $(Build.SourcesDirectory)/.ci/setup.sh + targetType: 'filePath' + - task: Bash@3 + displayName: Test + inputs: + filePath: $(Build.SourcesDirectory)/.ci/test.sh + targetType: 'filePath' - job: QEMU_multiarch ########################################### @@ -229,55 +229,55 @@ jobs: TASK: bdist ARCH: aarch64 steps: - - script: | - sudo apt-get update - sudo apt-get install --no-install-recommends -y \ - binfmt-support \ - qemu \ - qemu-user \ - qemu-user-static - displayName: 'Install QEMU' - - script: | - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - displayName: 'Enable Docker multi-architecture support' - - script: | - git clean -d -f -x - displayName: 'Clean source directory' - - script: | - cat > docker-script.sh < docker-script.sh < Date: Sun, 15 Dec 2024 07:40:12 +0300 Subject: [PATCH 35/39] Update .vsts-ci.yml --- .vsts-ci.yml | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 1867ca5f2a0c..0a23e955d593 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -133,7 +133,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 @@ -273,7 +278,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 @@ -325,7 +335,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 @@ -369,7 +384,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 @@ -388,9 +408,14 @@ jobs: - script: | LGB_VER=$(head -n 1 VERSION.txt | sed "s/rc/-/g") R_LIB_PATH=~/Rlib + R_LIBS="c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl')" + R_DEPS="c('Depends', 'Imports', 'LinkingTo')" + CRAN_MIRROR="https://cran.rstudio.com" + INSTALLATION_STR="install.packages(${R_LIBS}, lib = '${R_LIB_PATH}', " + INSTALLATION_STR+="dependencies = ${R_DEPS}, repos = '${CRAN_MIRROR}', Ncpus = parallel::detectCores())" export R_LIBS=${R_LIB_PATH} mkdir -p ${R_LIB_PATH} - 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 "${INSTALLATION_STR}" || 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 displayName: 'Build CRAN R-package' From 80698a8ed072304edb280be781c24d997d2f3868 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 07:55:56 +0300 Subject: [PATCH 36/39] Update r_package.yml --- .github/workflows/r_package.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/r_package.yml b/.github/workflows/r_package.yml index fc7c004bf144..1c70ca567319 100644 --- a/.github/workflows/r_package.yml +++ b/.github/workflows/r_package.yml @@ -231,10 +231,10 @@ jobs: - name: Install packages shell: bash run: | - R_LIBS="'R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'testthat'" + R_LIBS="c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'testthat')" CRAN_MIRROR="https://cran.rstudio.com" RDscript${{ matrix.r_customization }} \ - -e "install.packages(c(${R_LIBS}), repos = '${CRAN_MIRROR}', Ncpus = parallel::detectCores())" + -e "install.packages(${R_LIBS}, repos = '${CRAN_MIRROR}', 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 @@ -299,10 +299,10 @@ jobs: - name: Install packages and run tests shell: bash run: | - R_LIBS="'R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl'" + R_LIBS="c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl')" CRAN_MIRROR="https://cran.rstudio.com" Rscript \ - -e "install.packages(c(${R_LIBS}), repos = '${CRAN_MIRROR}', Ncpus = parallel::detectCores())" + -e "install.packages(${R_LIBS}, repos = '${CRAN_MIRROR}', Ncpus = parallel::detectCores())" sh build-cran-package.sh # 'rchk' isn't run through 'R CMD check', use the approach documented at From 5bcfba2ff16e55aebcf770e694e8ce16d0863cc2 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 07:57:52 +0300 Subject: [PATCH 37/39] Update static_analysis.yml --- .github/workflows/static_analysis.yml | 97 +++++++++++++-------------- 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index e03507c7a326..88d12b096121 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -6,7 +6,6 @@ on: push: branches: - master - - ci/yamllint pull_request: branches: - master @@ -32,7 +31,7 @@ jobs: matrix: include: - task: lint - # - task: check-docs + - task: check-docs steps: - name: Checkout repository uses: actions/checkout@v4 @@ -48,50 +47,50 @@ jobs: export PATH=${CONDA}/bin:$HOME/.local/bin:${PATH} $GITHUB_WORKSPACE/.ci/setup.sh || exit 1 $GITHUB_WORKSPACE/.ci/test.sh || exit 1 - # r-check-docs: - # name: r-package-check-docs - # timeout-minutes: 60 - # runs-on: ubuntu-latest - # container: rocker/verse - # steps: - # - name: Trust git cloning LightGBM - # run: | - # git config --global --add safe.directory "${GITHUB_WORKSPACE}" - # - name: Checkout repository - # uses: actions/checkout@v4 - # with: - # fetch-depth: 5 - # submodules: true - # - name: Install packages - # shell: bash - # run: | - # R_LIBS="'R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'roxygen2', 'testthat'" - # CRAN_MIRROR="https://cran.rstudio.com" - # Rscript -e "install.packages(c(${PACKS}), repos = '${CRAN_MIRROR}', Ncpus = parallel::detectCores())" - # sh build-cran-package.sh || exit 1 - # R CMD INSTALL --with-keep.source lightgbm_*.tar.gz || exit 1 - # - name: Test documentation - # shell: bash --noprofile --norc {0} - # run: | - # Rscript --vanilla -e "roxygen2::roxygenize('R-package/', load = 'installed')" || exit 1 - # num_doc_files_changed=$( - # git diff --name-only | grep --count -E "\.Rd|NAMESPACE" - # ) - # if [[ ${num_doc_files_changed} -gt 0 ]]; then - # echo "Some R documentation files have changed. Please re-generate them and commit those changes." - # echo "" - # echo " sh build-cran-package.sh" - # echo " R CMD INSTALL --with-keep.source lightgbm_*.tar.gz" - # echo " Rscript -e \"roxygen2::roxygenize('R-package/', load = 'installed')\"" - # echo "" - # exit 1 - # fi - # all-static-analysis-jobs-successful: - # if: always() - # runs-on: ubuntu-latest - # needs: [test, r-check-docs] - # steps: - # - name: Note that all tests succeeded - # uses: re-actors/alls-green@v1.2.2 - # with: - # jobs: ${{ toJSON(needs) }} + r-check-docs: + name: r-package-check-docs + timeout-minutes: 60 + runs-on: ubuntu-latest + container: rocker/verse + steps: + - name: Trust git cloning LightGBM + run: | + git config --global --add safe.directory "${GITHUB_WORKSPACE}" + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 5 + submodules: true + - name: Install packages + shell: bash + run: | + R_LIBS="c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'roxygen2', 'testthat')" + CRAN_MIRROR="https://cran.rstudio.com" + Rscript -e "install.packages(${R_LIBS}, repos = '${CRAN_MIRROR}', Ncpus = parallel::detectCores())" + sh build-cran-package.sh || exit 1 + R CMD INSTALL --with-keep.source lightgbm_*.tar.gz || exit 1 + - name: Test documentation + shell: bash --noprofile --norc {0} + run: | + Rscript --vanilla -e "roxygen2::roxygenize('R-package/', load = 'installed')" || exit 1 + num_doc_files_changed=$( + git diff --name-only | grep --count -E "\.Rd|NAMESPACE" + ) + if [[ ${num_doc_files_changed} -gt 0 ]]; then + echo "Some R documentation files have changed. Please re-generate them and commit those changes." + echo "" + echo " sh build-cran-package.sh" + echo " R CMD INSTALL --with-keep.source lightgbm_*.tar.gz" + echo " Rscript -e \"roxygen2::roxygenize('R-package/', load = 'installed')\"" + echo "" + exit 1 + fi + all-static-analysis-jobs-successful: + if: always() + runs-on: ubuntu-latest + needs: [test, r-check-docs] + steps: + - name: Note that all tests succeeded + uses: re-actors/alls-green@v1.2.2 + with: + jobs: ${{ toJSON(needs) }} From 07572eb65710fc4b921d961bfc55ae04cadecded Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 07:59:15 +0300 Subject: [PATCH 38/39] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 66 ++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5d10660b6f9a..8dab84685087 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,41 +12,41 @@ exclude: | |R-package/man/.*Rd$ repos: - # - repo: https://github.com/pre-commit/pre-commit-hooks - # rev: v5.0.0 - # hooks: - # - id: end-of-file-fixer - # - id: trailing-whitespace + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: end-of-file-fixer + - id: trailing-whitespace - repo: https://github.com/adrienverge/yamllint rev: v1.35.1 hooks: - id: yamllint args: ["--strict"] - # - repo: https://github.com/pycqa/isort - # rev: 5.13.2 - # hooks: - # - id: isort - # name: isort (python) - # args: ["--settings-path", "python-package/pyproject.toml"] - # - repo: https://github.com/astral-sh/ruff-pre-commit - # # Ruff version. - # rev: v0.7.0 - # hooks: - # # Run the linter. - # - id: ruff - # args: ["--config", "python-package/pyproject.toml"] - # types_or: [python, jupyter] - # # Run the formatter. - # - id: ruff-format - # args: ["--config", "python-package/pyproject.toml"] - # types_or: [python, jupyter] - # - repo: https://github.com/shellcheck-py/shellcheck-py - # rev: v0.10.0.1 - # hooks: - # - id: shellcheck - # - repo: https://github.com/crate-ci/typos - # rev: v1.23.2 - # hooks: - # - id: typos - # args: ["--force-exclude"] - # exclude: (\.gitignore$)|(^\.editorconfig$) + - repo: https://github.com/pycqa/isort + rev: 5.13.2 + hooks: + - id: isort + name: isort (python) + args: ["--settings-path", "python-package/pyproject.toml"] + - repo: https://github.com/astral-sh/ruff-pre-commit + # Ruff version. + rev: v0.7.0 + hooks: + # Run the linter. + - id: ruff + args: ["--config", "python-package/pyproject.toml"] + types_or: [python, jupyter] + # Run the formatter. + - id: ruff-format + args: ["--config", "python-package/pyproject.toml"] + types_or: [python, jupyter] + - repo: https://github.com/shellcheck-py/shellcheck-py + rev: v0.10.0.1 + hooks: + - id: shellcheck + - repo: https://github.com/crate-ci/typos + rev: v1.23.2 + hooks: + - id: typos + args: ["--force-exclude"] + exclude: (\.gitignore$)|(^\.editorconfig$) From ea8897f4ccfba396dcbd341088ce6ceac5766ebc Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Sun, 15 Dec 2024 08:10:31 +0300 Subject: [PATCH 39/39] Update static_analysis.yml --- .github/workflows/static_analysis.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index 88d12b096121..2a61923bd5aa 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -64,7 +64,8 @@ jobs: - name: Install packages shell: bash run: | - R_LIBS="c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'roxygen2', 'testthat')" + R_LIBS="c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown'" + R_LIBS+=", 'Matrix', 'RhpcBLASctl', 'roxygen2', 'testthat')" CRAN_MIRROR="https://cran.rstudio.com" Rscript -e "install.packages(${R_LIBS}, repos = '${CRAN_MIRROR}', Ncpus = parallel::detectCores())" sh build-cran-package.sh || exit 1 @@ -90,7 +91,7 @@ jobs: runs-on: ubuntu-latest needs: [test, r-check-docs] steps: - - name: Note that all tests succeeded - uses: re-actors/alls-green@v1.2.2 - with: - jobs: ${{ toJSON(needs) }} + - name: Note that all tests succeeded + uses: re-actors/alls-green@v1.2.2 + with: + jobs: ${{ toJSON(needs) }}