diff --git a/.ci/README.md b/.ci/README.md deleted file mode 100644 index 3805703d..00000000 --- a/.ci/README.md +++ /dev/null @@ -1,6 +0,0 @@ -Helper Scripts for CI -===================== - -This folder contains scripts which are run on CI services. - -Dockerfile used on CI service is maintained in a separate [GitHub repository](https://github.com/guolinke/lightgbm-ci-docker) and can be pulled from [Docker Hub](https://hub.docker.com/r/lightgbm/vsts-agent). diff --git a/.ci/append_comment.sh b/.ci/append_comment.sh deleted file mode 100755 index 14e01112..00000000 --- a/.ci/append_comment.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# -# [description] -# Update comment appending a given body to the specified original comment. -# -# [usage] -# append_comment.sh -# -# COMMENT_ID: ID of comment that should be modified. -# -# BODY: Text that will be appended to the original comment body. - -set -e - -if [ -z "$GITHUB_ACTIONS" ]; then - echo "Must be run inside GitHub Actions CI" - exit -1 -fi - -if [ $# -ne 2 ]; then - echo "Usage: $0 " - exit -1 -fi - -comment_id=$1 -body=$2 - -old_comment_body=$( - curl -sL \ - -H "Accept: application/vnd.github.v3+json" \ - -H "Authorization: token $SECRETS_WORKFLOW" \ - "${GITHUB_API_URL}/repos/microsoft/LightGBM/issues/comments/$comment_id" | \ - jq '.body' -) -body=${body/failure/failure ❌} -body=${body/error/failure ❌} -body=${body/cancelled/failure ❌} -body=${body/timed_out/failure ❌} -body=${body/success/success ✔️} -data=$( - jq -n \ - --argjson body "${old_comment_body%?}\r\n\r\n$body\"" \ - '{"body":$body}' -) -curl -sL \ - -X PATCH \ - -H "Accept: application/vnd.github.v3+json" \ - -H "Authorization: token $SECRETS_WORKFLOW" \ - -d "$data" \ - "${GITHUB_API_URL}/repos/microsoft/LightGBM/issues/comments/$comment_id" diff --git a/.ci/get_workflow_status.py b/.ci/get_workflow_status.py deleted file mode 100644 index e693ec63..00000000 --- a/.ci/get_workflow_status.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 -"""Get the most recent status of workflow for the current PR. - -[usage] - python get_workflow_status.py TRIGGER_PHRASE - -TRIGGER_PHRASE: Code phrase that triggers workflow. -""" -import json -from os import environ -from sys import argv, exit -from time import sleep - -try: - from urllib import request -except ImportError: - import urllib2 as request - - -def get_runs(trigger_phrase): - """Get all triggering workflow comments in the current PR. - - Parameters - ---------- - trigger_phrase : string - Code phrase that triggers workflow. - - Returns - ------- - pr_runs : list - List of comment objects sorted by the time of creation in decreasing order. - """ - pr_runs = [] - if environ.get("GITHUB_EVENT_NAME", "") == "pull_request": - pr_number = int(environ.get("GITHUB_REF").split('/')[-2]) - req = request.Request(url="{}/repos/microsoft/LightGBM/issues/{}/comments".format(environ.get("GITHUB_API_URL"), - pr_number), - headers={"Accept": "application/vnd.github.v3+json"}) - url = request.urlopen(req) - data = json.loads(url.read().decode('utf-8')) - url.close() - pr_runs = [i for i in data - if i['author_association'].lower() in {'owner', 'member', 'collaborator'} - and i['body'].startswith('/gha run {}'.format(trigger_phrase))] - return pr_runs[::-1] - - -def get_status(runs): - """Get the most recent status of workflow for the current PR. - - Parameters - ---------- - runs : list - List of comment objects sorted by the time of creation in decreasing order. - - Returns - ------- - status : string - The most recent status of workflow. - Can be 'success', 'failure' or 'in-progress'. - """ - status = 'success' - for run in runs: - body = run['body'] - if "Status: " in body: - if "Status: skipped" in body: - continue - if "Status: failure" in body: - status = 'failure' - break - if "Status: success" in body: - status = 'success' - break - else: - status = 'in-progress' - break - return status - - -if __name__ == "__main__": - trigger_phrase = argv[1] - while True: - status = get_status(get_runs(trigger_phrase)) - if status != 'in-progress': - break - sleep(60) - if status == 'failure': - exit(1) diff --git a/.ci/install_opencl.ps1 b/.ci/install_opencl.ps1 deleted file mode 100644 index fcf87cf8..00000000 --- a/.ci/install_opencl.ps1 +++ /dev/null @@ -1,34 +0,0 @@ -Write-Output "Installing OpenCL CPU platform" - -$installer = "AMD-APP-SDKInstaller-v3.0.130.135-GA-windows-F-x64.exe" - -Write-Output "Downloading OpenCL platform installer" -$ProgressPreference = "SilentlyContinue" # progress bar bug extremely slows down download speed -Invoke-WebRequest -OutFile "$installer" -Uri "https://github.com/microsoft/LightGBM/releases/download/v2.0.12/$installer" - -if (Test-Path "$installer") { - Write-Output "Successfully downloaded OpenCL platform installer" -} else { - Write-Output "Unable to download OpenCL platform installer" - Write-Output "Setting EXIT" - $host.SetShouldExit(-1) - Exit -1 -} - -# Install OpenCL platform from installer executable -Write-Output "Running OpenCL installer" -Invoke-Command -ScriptBlock { Start-Process "$installer" -ArgumentList '/S /V"/quiet /norestart /passive /log opencl.log"' -Wait } - -$property = Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenCL\Vendors -if ($property -eq $null) { - Write-Output "Unable to install OpenCL CPU platform" - Write-Output "OpenCL installation log:" - Get-Content "opencl.log" - Write-Output "Setting EXIT" - $host.SetShouldExit(-1) - Exit -1 -} else { - Write-Output "Successfully installed OpenCL CPU platform" - Write-Output "Current OpenCL drivers:" - Write-Output $property -} diff --git a/.ci/rerun_workflow.sh b/.ci/rerun_workflow.sh deleted file mode 100755 index eb098ade..00000000 --- a/.ci/rerun_workflow.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# -# [description] -# Rerun specified workflow for given pull request. -# -# [usage] -# rerun_workflow.sh -# -# WORKFLOW_ID: Identifier (config name of ID) of a workflow to be rerun. -# -# PR_NUMBER: Number of pull request for which workflow should be rerun. -# -# PR_BRANCH: Name of pull request's branch. - -set -e - -if [ -z "$GITHUB_ACTIONS" ]; then - echo "Must be run inside GitHub Actions CI" - exit -1 -fi - -if [ $# -ne 3 ]; then - echo "Usage: $0 " - exit -1 -fi - -workflow_id=$1 -pr_number=$2 -pr_branch=$3 - -runs=$( - curl -sL \ - -H "Accept: application/vnd.github.v3+json" \ - -H "Authorization: token $SECRETS_WORKFLOW" \ - "${GITHUB_API_URL}/repos/microsoft/LightGBM/actions/workflows/${workflow_id}/runs?event=pull_request&branch=${pr_branch}" | \ - jq '.workflow_runs' -) -runs=$(echo $runs | jq --arg pr_number "$pr_number" --arg pr_branch "$pr_branch" 'map(select(.event == "pull_request" and ((.pull_requests | length) != 0 and (.pull_requests[0].number | tostring) == $pr_number or .head_branch == $pr_branch)))') -runs=$(echo $runs | jq 'sort_by(.run_number) | reverse') - -if [[ $(echo $runs | jq 'length') -gt 0 ]]; then - curl -sL \ - -X POST \ - -H "Accept: application/vnd.github.v3+json" \ - -H "Authorization: token $SECRETS_WORKFLOW" \ - "${GITHUB_API_URL}/repos/microsoft/LightGBM/actions/runs/$(echo $runs | jq '.[0].id')/rerun" -fi diff --git a/.ci/run_rhub_solaris_checks.R b/.ci/run_rhub_solaris_checks.R deleted file mode 100644 index 98f1e251..00000000 --- a/.ci/run_rhub_solaris_checks.R +++ /dev/null @@ -1,92 +0,0 @@ -args <- commandArgs( - trailingOnly = TRUE -) -package_tarball <- args[[1L]] -log_file <- args[[2L]] -dir.create(dirname(log_file), recursive = TRUE, showWarnings = FALSE) - -email <- c( - 150L, 147L, 145L, 146L, 158L, 145L, 140L, 151L, 137L, 156L, 146L, 159L, 140L, 137L, 141L, 146L, - 143L, 141L, 149L, 157L, 106L, 163L, 153L, 154L, 151L, 139L, 147L, 150L, 88L, 141L, 153L, 151L -) -token <- c( - 91L, 98L, 91L, 142L, 142L, 99L, 96L, 91L, 98L, 94L, 99L, 92L, 94L, 144L, 90L, 139L, - 139L, 143L, 139L, 91L, 99L, 142L, 97L, 93L, 144L, 99L, 139L, 143L, 97L, 99L, 97L, 94L -) - -if (Sys.info()["sysname"] == "Windows") { - null_file <- "NUL" -} else { - null_file <- "/dev/null" -} - -sink(file = null_file) -rhub::validate_email( - email = intToUtf8(email - 42L) - , token = intToUtf8(token - 42L) -) -sink() - -checks_succeeded <- TRUE -platforms <- c( - "solaris-x86-patched" - , "solaris-x86-patched-ods" -) -sink(file = null_file) -for (platform in platforms) { - res_object <- rhub::check( - path = package_tarball - , email = intToUtf8(email - 42L) - , check_args = "--as-cran" - , platform = platform - , env_vars = c( - "R_COMPILE_AND_INSTALL_PACKAGES" = "always" - , "_R_CHECK_SYSTEM_CLOCK_" = 0L - , "_R_CHECK_CRAN_INCOMING_REMOTE_" = 0L - , "_R_CHECK_PKG_SIZES_THRESHOLD_" = 60L - , "_R_CHECK_TOPLEVEL_FILES_" = 0L - ) - , show_status = TRUE - ) - statuses <- res_object[[".__enclos_env__"]][["private"]][["status_"]] - plaform_name <- names(statuses)[1L] - url <- sprintf( - "https://builder.r-hub.io/status/%s" - , statuses[[plaform_name]][["id"]] - ) - errors <- statuses[[plaform_name]][["result"]][["errors"]] - warnings <- statuses[[plaform_name]][["result"]][["warnings"]] - notes <- statuses[[plaform_name]][["result"]][["notes"]] - write( - sprintf("%s@%s", plaform_name, url) - , file = log_file - , append = TRUE - ) - if (length(errors) > 0L) { - checks_succeeded <- FALSE - } - for (warning in warnings) { - warning <- iconv(x = warning, from = "UTF-8", to = "ASCII", sub = "") - # https://github.com/r-hub/rhub/issues/113 - if (!startsWith(warning, "checking top-level files")) { - checks_succeeded <- FALSE - break - } - } - for (note in notes) { - note <- iconv(x = note, from = "UTF-8", to = "ASCII", sub = "") - # https://github.com/r-hub/rhub/issues/415 - if (!(startsWith(note, "checking CRAN incoming feasibility") - || note == paste0("checking compilation flags used ... NOTE\n" - , "Compilation used the following non-portable flag(s):\n -march=pentiumpro"))) { - checks_succeeded <- FALSE - break - } - } - if (!checks_succeeded) { - break - } -} -sink() - -quit(save = "no", status = as.integer(!checks_succeeded)) diff --git a/.ci/set_commit_status.sh b/.ci/set_commit_status.sh deleted file mode 100755 index b10dd3ec..00000000 --- a/.ci/set_commit_status.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# -# [description] -# Set a status with a given name to the specified commit. -# -# [usage] -# set_commit_status.sh -# -# NAME: Name of status. -# Status with existing name overwrites a previous one. -# -# STATUS: Status to be set. -# Can be "error", "failure", "pending" or "success". -# -# SHA: SHA of a commit to set a status on. - -set -e - -if [ -z "$GITHUB_ACTIONS" ]; then - echo "Must be run inside GitHub Actions CI" - exit -1 -fi - -if [ $# -ne 3 ]; then - echo "Usage: $0 " - exit -1 -fi - -name=$1 - -status=$2 -status=${status/error/failure} -status=${status/cancelled/failure} -status=${status/timed_out/failure} -status=${status/in_progress/pending} -status=${status/queued/pending} - -sha=$3 - -data=$( - jq -n \ - --arg state $status \ - --arg url "${GITHUB_SERVER_URL}/microsoft/LightGBM/actions/runs/${GITHUB_RUN_ID}" \ - --arg name "$name" \ - '{"state":$state,"target_url":$url,"context":$name}' -) - -curl -sL \ - -X POST \ - -H "Accept: application/vnd.github.v3+json" \ - -H "Authorization: token $SECRETS_WORKFLOW" \ - -d "$data" \ - "${GITHUB_API_URL}/repos/microsoft/LightGBM/statuses/$sha" diff --git a/.ci/test.sh b/.ci/test.sh index 659efe06..18fdd460 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -9,8 +9,8 @@ elif [[ $OS_NAME == "linux" ]] && [[ $COMPILER == "clang" ]]; then fi if [[ "${TASK}" == "r-package" ]]; then - bash ${BUILD_DIRECTORY}/.ci/test_r_package.sh || exit -1 - exit 0 + echo "R package support has been removed from this fork" + exit 1 fi if [[ "$TASK" == "cpp-tests" ]]; then diff --git a/.ci/test_r_package.sh b/.ci/test_r_package.sh deleted file mode 100755 index 1f502954..00000000 --- a/.ci/test_r_package.sh +++ /dev/null @@ -1,200 +0,0 @@ -#!/bin/bash - -# set up R environment -CRAN_MIRROR="https://cloud.r-project.org/" -R_LIB_PATH=~/Rlib -mkdir -p $R_LIB_PATH -export R_LIBS=$R_LIB_PATH -export PATH="$R_LIB_PATH/R/bin:$PATH" - -# don't fail builds for long-running examples unless they're very long. -# See https://github.com/microsoft/LightGBM/issues/4049#issuecomment-793412254. -if [[ $R_BUILD_TYPE != "cran" ]]; then - export _R_CHECK_EXAMPLE_TIMING_THRESHOLD_=30 -fi - -# Get details needed for installing R components -R_MAJOR_VERSION=( ${R_VERSION//./ } ) -if [[ "${R_MAJOR_VERSION}" == "3" ]]; then - export R_MAC_VERSION=3.6.3 - export R_LINUX_VERSION="3.6.3-1bionic" - export R_APT_REPO="bionic-cran35/" -elif [[ "${R_MAJOR_VERSION}" == "4" ]]; then - export R_MAC_VERSION=4.0.5 - export R_LINUX_VERSION="4.0.5-1.2004.0" - export R_APT_REPO="focal-cran40/" -else - echo "Unrecognized R version: ${R_VERSION}" - exit -1 -fi - -# installing precompiled R for Ubuntu -# https://cran.r-project.org/bin/linux/ubuntu/#installation -# adding steps from https://stackoverflow.com/a/56378217/3986677 to get latest version -# -# `devscripts` is required for 'checkbashisms' (https://github.com/r-lib/actions/issues/111) -if [[ $OS_NAME == "linux" ]]; then - sudo apt-key adv \ - --keyserver keyserver.ubuntu.com \ - --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 - sudo add-apt-repository \ - "deb https://cloud.r-project.org/bin/linux/ubuntu ${R_APT_REPO}" - sudo apt-get update - sudo apt-get install \ - --no-install-recommends \ - -y --allow-downgrades \ - devscripts \ - r-base-dev=${R_LINUX_VERSION} \ - texinfo \ - texlive-latex-extra \ - texlive-latex-recommended \ - texlive-fonts-recommended \ - texlive-fonts-extra \ - qpdf \ - || exit -1 - - if [[ $R_BUILD_TYPE == "cran" ]]; then - sudo apt-get install \ - --no-install-recommends \ - -y \ - autoconf=$(cat R-package/AUTOCONF_UBUNTU_VERSION) \ - || exit -1 - fi -fi - -# Installing R precompiled for Mac OS 10.11 or higher -if [[ $OS_NAME == "macos" ]]; then - brew update-reset && brew update - if [[ $R_BUILD_TYPE == "cran" ]]; then - brew install automake - fi - brew install \ - checkbashisms \ - qpdf - brew install --cask basictex - export PATH="/Library/TeX/texbin:$PATH" - sudo tlmgr --verify-repo=none update --self - sudo tlmgr --verify-repo=none install inconsolata helvetic - - curl -sL https://cran.r-project.org/bin/macosx/R-${R_MAC_VERSION}.pkg -o R.pkg - sudo installer \ - -pkg $(pwd)/R.pkg \ - -target / - - # Fix "duplicate libomp versions" issue on Mac - # by replacing the R libomp.dylib with a symlink to the one installed with brew - if [[ $COMPILER == "clang" ]]; then - ver_arr=( ${R_MAC_VERSION//./ } ) - R_MAJOR_MINOR="${ver_arr[0]}.${ver_arr[1]}" - sudo ln -sf \ - "$(brew --cellar libomp)"/*/lib/libomp.dylib \ - /Library/Frameworks/R.framework/Versions/${R_MAJOR_MINOR}/Resources/lib/libomp.dylib - fi -fi - -# Manually install Depends and Imports libraries + 'testthat' -# to avoid a CI-time dependency on devtools (for devtools::install_deps()) -packages="c('data.table', 'jsonlite', 'Matrix', 'R6', 'testthat')" -compile_from_source="both" -if [[ $OS_NAME == "macos" ]]; then - packages+=", type = 'binary'" - compile_from_source="never" -fi -Rscript --vanilla -e "options(install.packages.compile.from.source = '${compile_from_source}'); install.packages(${packages}, repos = '${CRAN_MIRROR}', lib = '${R_LIB_PATH}', dependencies = c('Depends', 'Imports', 'LinkingTo'), Ncpus = parallel::detectCores())" || exit -1 - -cd ${BUILD_DIRECTORY} - -PKG_TARBALL="lightgbm_*.tar.gz" -LOG_FILE_NAME="lightgbm.Rcheck/00check.log" -if [[ $R_BUILD_TYPE == "cmake" ]]; then - Rscript build_r.R --skip-install || exit -1 -elif [[ $R_BUILD_TYPE == "cran" ]]; then - - # on Linux, we recreate configure in CI to test if - # a change in a PR has changed configure.ac - if [[ $OS_NAME == "linux" ]]; then - ${BUILD_DIRECTORY}/R-package/recreate-configure.sh - - num_files_changed=$( - git diff --name-only | wc -l - ) - if [[ ${num_files_changed} -gt 0 ]]; then - echo "'configure' in the R package has changed. Please recreate it and commit the changes." - echo "Changed files:" - git diff --compact-summary - echo "See R-package/README.md for details on how to recreate this script." - echo "" - exit -1 - fi - fi - - ./build-cran-package.sh || exit -1 - - # Test CRAN source .tar.gz in a directory that is not this repo or below it. - # When people install.packages('lightgbm'), they won't have the LightGBM - # git repo around. This is to protect against the use of relative paths - # like ../../CMakeLists.txt that would only work if you are in the repo - R_CMD_CHECK_DIR="${HOME}/tmp-r-cmd-check/" - mkdir -p ${R_CMD_CHECK_DIR} - mv ${PKG_TARBALL} ${R_CMD_CHECK_DIR} - cd ${R_CMD_CHECK_DIR} -fi - -# fails tests if either ERRORs or WARNINGs are thrown by -# R CMD CHECK -check_succeeded="yes" -( - R CMD check ${PKG_TARBALL} \ - --as-cran \ - --run-donttest \ - || check_succeeded="no" -) & - -# R CMD check suppresses output, some CIs kill builds after -# a few minutes with no output. This trick gives R CMD check more time -# * https://github.com/travis-ci/travis-ci/issues/4190#issuecomment-169987525 -# * https://stackoverflow.com/a/29890106/3986677 -CHECK_PID=$! -while kill -0 ${CHECK_PID} >/dev/null 2>&1; do - echo -n -e " \b" - sleep 5 -done - -echo "R CMD check build logs:" -BUILD_LOG_FILE=lightgbm.Rcheck/00install.out -cat ${BUILD_LOG_FILE} - -if [[ $check_succeeded == "no" ]]; then - exit -1 -fi - -if grep -q -E "NOTE|WARNING|ERROR" "$LOG_FILE_NAME"; then - echo "NOTEs, WARNINGs, or ERRORs have been found by R CMD check" - exit -1 -fi - -# this check makes sure that CI builds of the CRAN package on Mac -# actually use OpenMP -if [[ $OS_NAME == "macos" ]] && [[ $R_BUILD_TYPE == "cran" ]]; then - omp_working=$( - cat $BUILD_LOG_FILE \ - | grep --count -E "checking whether OpenMP will work .*yes" - ) - if [[ $omp_working -ne 1 ]]; then - echo "OpenMP was not found, and should be when testing the CRAN package on macOS" - exit -1 - fi -fi - -# this check makes sure that no "warning: unknown pragma ignored" logs -# reach the user leading them to believe that something went wrong -if [[ $R_BUILD_TYPE == "cran" ]]; then - pragma_warning_present=$( - cat $BUILD_LOG_FILE \ - | grep --count -E "warning: unknown pragma ignored" - ) - if [[ $pragma_warning_present -ne 0 ]]; then - echo "Unknown pragma warning is present, pragmas should have been removed before build" - exit -1 - fi -fi diff --git a/.ci/test_r_package_valgrind.sh b/.ci/test_r_package_valgrind.sh deleted file mode 100755 index f17b3bc8..00000000 --- a/.ci/test_r_package_valgrind.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/bash - -cd R-package/tests - -ALL_LOGS_FILE="out.log" -VALGRIND_LOGS_FILE="valgrind-logs.log" - -RDvalgrind \ - --no-readline \ - --vanilla \ - -d "valgrind --tool=memcheck --leak-check=full --track-origins=yes" \ - -f testthat.R \ - > ${ALL_LOGS_FILE} 2>&1 || exit -1 - -cat ${ALL_LOGS_FILE} - -echo "writing valgrind output to ${VALGRIND_LOGS_FILE}" -cat ${ALL_LOGS_FILE} | grep -E "^\=" > ${VALGRIND_LOGS_FILE} - -bytes_definitely_lost=$( - cat ${VALGRIND_LOGS_FILE} \ - | grep -E "definitely lost\: .*" \ - | sed 's/^.*definitely lost\: \(.*\) bytes.*$/\1/' \ - | tr -d "," -) -echo "valgrind found ${bytes_definitely_lost} bytes definitely lost" -if [[ ${bytes_definitely_lost} -gt 0 ]]; then - exit -1 -fi - -bytes_indirectly_lost=$( - cat ${VALGRIND_LOGS_FILE} \ - | grep -E "indirectly lost\: .*" \ - | sed 's/^.*indirectly lost\: \(.*\) bytes.*$/\1/' \ - | tr -d "," -) -echo "valgrind found ${bytes_indirectly_lost} bytes indirectly lost" -if [[ ${bytes_indirectly_lost} -gt 0 ]]; then - exit -1 -fi - -# one error caused by a false positive between valgrind and openmp is allowed -# ==2063== 336 bytes in 1 blocks are possibly lost in loss record 153 of 2,709 -# ==2063== at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) -# ==2063== by 0x40149CA: allocate_dtv (dl-tls.c:286) -# ==2063== by 0x40149CA: _dl_allocate_tls (dl-tls.c:532) -# ==2063== by 0x5702322: allocate_stack (allocatestack.c:622) -# ==2063== by 0x5702322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660) -# ==2063== by 0x56D0DDA: ??? (in /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0) -# ==2063== by 0x56C88E0: GOMP_parallel (in /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0) -# ==2063== by 0x1544D29C: LGBM_DatasetCreateFromCSC (c_api.cpp:1286) -# ==2063== by 0x1546F980: LGBM_DatasetCreateFromCSC_R (lightgbm_R.cpp:91) -# ==2063== by 0x4941E2F: R_doDotCall (dotcode.c:634) -# ==2063== by 0x494CCC6: do_dotcall (dotcode.c:1281) -# ==2063== by 0x499FB01: bcEval (eval.c:7078) -# ==2063== by 0x498B67F: Rf_eval (eval.c:727) -# ==2063== by 0x498E414: R_execClosure (eval.c:1895) -bytes_possibly_lost=$( - cat ${VALGRIND_LOGS_FILE} \ - | grep -E "possibly lost\: .*" \ - | sed 's/^.*possibly lost\: \(.*\) bytes.*$/\1/' \ - | tr -d "," -) -echo "valgrind found ${bytes_possibly_lost} bytes possibly lost" -if [[ ${bytes_possibly_lost} -gt 336 ]]; then - exit -1 -fi - -invalid_reads=$( - cat ${VALGRIND_LOGS_FILE} \ - | grep --count -i "Invalid read" -) -if [[ ${invalid_reads} -gt 0 ]]; then - echo "valgrind found invalid reads: ${invalid_reads}" - exit -1 -fi - -invalid_writes=$( - cat ${VALGRIND_LOGS_FILE} \ - | grep --count -i "Invalid write" -) -if [[ ${invalid_writes} -gt 0 ]]; then - echo "valgrind found invalid writes: ${invalid_writes}" - exit -1 -fi diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 deleted file mode 100644 index 47357fa7..00000000 --- a/.ci/test_r_package_windows.ps1 +++ /dev/null @@ -1,229 +0,0 @@ -# Download a file and retry upon failure. This looks like -# an infinite loop but CI-level timeouts will kill it -function Download-File-With-Retries { - param( - [string]$url, - [string]$destfile - ) - $ProgressPreference = "SilentlyContinue" # progress bar bug extremely slows down download speed - do { - Write-Output "Downloading ${url}" - sleep 5; - Invoke-WebRequest -Uri $url -OutFile $destfile - } while(!$?); -} - -# External utilities like R.exe / Rscript.exe writing to stderr (even for harmless -# status information) can cause failures in GitHub Actions PowerShell jobs. -# See https://github.community/t/powershell-steps-fail-nondeterministically/115496 -# -# Using standard PowerShell redirection does not work to avoid these errors. -# This function uses R's built-in redirection mechanism, sink(). Any place where -# this function is used is a command that writes harmless messages to stderr -function Run-R-Code-Redirect-Stderr { - param( - [string]$rcode - ) - $decorated_code = "out_file <- file(tempfile(), open = 'wt'); sink(out_file, type = 'message'); $rcode; sink()" - Rscript --vanilla -e $decorated_code -} - -# Remove all items matching some pattern from PATH environment variable -function Remove-From-Path { - param( - [string]$pattern_to_remove - ) - $env:PATH = ($env:PATH.Split(';') | Where-Object { $_ -notmatch "$pattern_to_remove" }) -join ';' -} - -# remove some details that exist in the GitHub Actions images which might -# cause conflicts with R and other components installed by this script -$env:RTOOLS40_HOME = "" -Remove-From-Path ".*chocolatey.*" -Remove-From-Path ".*Chocolatey.*" -Remove-From-Path ".*Git.*mingw64.*" -Remove-From-Path ".*msys64.*" -Remove-From-Path ".*rtools40.*" -Remove-From-Path ".*Strawberry.*" - -Remove-Item C:\rtools40 -Force -Recurse -ErrorAction Ignore - -# Get details needed for installing R components -# -# NOTES: -# * some paths and file names are different on R4.0 -$env:R_MAJOR_VERSION = $env:R_VERSION.split('.')[0] -if ($env:R_MAJOR_VERSION -eq "3") { - # Rtools 3.x has to be installed at C:\Rtools\ - # * https://stackoverflow.com/a/46619260/3986677 - $RTOOLS_INSTALL_PATH = "C:\Rtools" - $env:RTOOLS_BIN = "$RTOOLS_INSTALL_PATH\bin" - $env:RTOOLS_MINGW_BIN = "$RTOOLS_INSTALL_PATH\mingw_64\bin" - $env:RTOOLS_EXE_FILE = "rtools35-x86_64.exe" - $env:R_WINDOWS_VERSION = "3.6.3" -} elseif ($env:R_MAJOR_VERSION -eq "4") { - $RTOOLS_INSTALL_PATH = "C:\rtools40" - $env:RTOOLS_BIN = "$RTOOLS_INSTALL_PATH\usr\bin" - $env:RTOOLS_MINGW_BIN = "$RTOOLS_INSTALL_PATH\mingw64\bin" - $env:RTOOLS_EXE_FILE = "rtools40-x86_64.exe" - $env:R_WINDOWS_VERSION = "4.0.5" -} else { - Write-Output "[ERROR] Unrecognized R version: $env:R_VERSION" - Check-Output $false -} - -$env:R_LIB_PATH = "$env:BUILD_SOURCESDIRECTORY/RLibrary" -replace '[\\]', '/' -$env:R_LIBS = "$env:R_LIB_PATH" -$env:PATH = "$env:RTOOLS_BIN;" + "$env:RTOOLS_MINGW_BIN;" + "$env:R_LIB_PATH/R/bin/x64;" + "$env:R_LIB_PATH/miktex/texmfs/install/miktex/bin/x64;" + $env:PATH -$env:CRAN_MIRROR = "https://cloud.r-project.org/" -$env:CTAN_MIRROR = "https://ctan.math.illinois.edu/systems/win32/miktex" -$env:CTAN_PACKAGE_ARCHIVE = "$env:CTAN_MIRROR/tm/packages/" - -# don't fail builds for long-running examples unless they're very long. -# See https://github.com/microsoft/LightGBM/issues/4049#issuecomment-793412254. -if ($env:R_BUILD_TYPE -ne "cran") { - $env:_R_CHECK_EXAMPLE_TIMING_THRESHOLD_ = 30 -} - -if (($env:COMPILER -eq "MINGW") -and ($env:R_BUILD_TYPE -eq "cmake")) { - $env:CXX = "$env:RTOOLS_MINGW_BIN/g++.exe" - $env:CC = "$env:RTOOLS_MINGW_BIN/gcc.exe" -} - -cd $env:BUILD_SOURCESDIRECTORY -tzutil /s "GMT Standard Time" -[Void][System.IO.Directory]::CreateDirectory($env:R_LIB_PATH) - -# download R and RTools -Write-Output "Downloading R and Rtools" -Download-File-With-Retries -url "https://cran.r-project.org/bin/windows/base/old/$env:R_WINDOWS_VERSION/R-$env:R_WINDOWS_VERSION-win.exe" -destfile "R-win.exe" -Download-File-With-Retries -url "https://github.com/microsoft/LightGBM/releases/download/v2.0.12/$env:RTOOLS_EXE_FILE" -destfile "Rtools.exe" - -# Install R -Write-Output "Installing R" -Start-Process -FilePath R-win.exe -NoNewWindow -Wait -ArgumentList "/VERYSILENT /DIR=$env:R_LIB_PATH/R /COMPONENTS=main,x64,i386" ; Check-Output $? -Write-Output "Done installing R" - -Write-Output "Installing Rtools" -Start-Process -FilePath Rtools.exe -NoNewWindow -Wait -ArgumentList "/VERYSILENT /SUPPRESSMSGBOXES /DIR=$RTOOLS_INSTALL_PATH" ; Check-Output $? -Write-Output "Done installing Rtools" - -Write-Output "Installing dependencies" -$packages = "c('data.table', 'jsonlite', 'Matrix', 'processx', 'R6', 'testthat'), dependencies = c('Imports', 'Depends', 'LinkingTo')" -Run-R-Code-Redirect-Stderr "options(install.packages.check.source = 'no'); install.packages($packages, repos = '$env:CRAN_MIRROR', type = 'binary', lib = '$env:R_LIB_PATH', Ncpus = parallel::detectCores())" ; Check-Output $? - -# MiKTeX and pandoc can be skipped on non-MinGW builds, since we don't -# build the package documentation for those. -# -# MiKTeX always needs to be built to test a CRAN package. -if (($env:COMPILER -eq "MINGW") -or ($env:R_BUILD_TYPE -eq "cran")) { - Download-File-With-Retries "https://github.com/microsoft/LightGBM/releases/download/v2.0.12/miktexsetup-4.0-x64.zip" -destfile "miktexsetup-x64.zip" - Add-Type -AssemblyName System.IO.Compression.FileSystem - [System.IO.Compression.ZipFile]::ExtractToDirectory("miktexsetup-x64.zip", "miktex") - Write-Output "Setting up MiKTeX" - .\miktex\miktexsetup.exe --remote-package-repository="$env:CTAN_PACKAGE_ARCHIVE" --local-package-repository=./miktex/download --package-set=essential --quiet download ; Check-Output $? - Write-Output "Installing MiKTeX" - .\miktex\download\miktexsetup.exe --remote-package-repository="$env:CTAN_PACKAGE_ARCHIVE" --portable="$env:R_LIB_PATH/miktex" --quiet install ; Check-Output $? - Write-Output "Done installing MiKTeX" - - Run-R-Code-Redirect-Stderr "result <- processx::run(command = 'initexmf', args = c('--set-config-value', '[MPM]AutoInstall=1'), echo = TRUE, windows_verbatim_args = TRUE, error_on_status = TRUE)" ; Check-Output $? -} - -Write-Output "Building R package" - -# R CMD check is not used for MSVC builds -if ($env:COMPILER -ne "MSVC") { - - $PKG_FILE_NAME = "lightgbm_*.tar.gz" - $LOG_FILE_NAME = "lightgbm.Rcheck/00check.log" - - if ($env:R_BUILD_TYPE -eq "cmake") { - if ($env:TOOLCHAIN -eq "MINGW") { - Write-Output "Telling R to use MinGW" - $env:BUILD_R_FLAGS = "c('--skip-install', '--use-mingw')" - } elseif ($env:TOOLCHAIN -eq "MSYS") { - Write-Output "Telling R to use MSYS" - $env:BUILD_R_FLAGS = "c('--skip-install', '--use-msys2')" - } elseif ($env:TOOLCHAIN -eq "MSVC") { - $env:BUILD_R_FLAGS = "'--skip-install'" - } else { - Write-Output "[ERROR] Unrecognized toolchain: $env:TOOLCHAIN" - Check-Output $false - } - Run-R-Code-Redirect-Stderr "commandArgs <- function(...){$env:BUILD_R_FLAGS}; source('build_r.R')"; Check-Output $? - } elseif ($env:R_BUILD_TYPE -eq "cran") { - Run-R-Code-Redirect-Stderr "result <- processx::run(command = 'sh', args = 'build-cran-package.sh', echo = TRUE, windows_verbatim_args = FALSE, error_on_status = TRUE)" ; Check-Output $? - # Test CRAN source .tar.gz in a directory that is not this repo or below it. - # When people install.packages('lightgbm'), they won't have the LightGBM - # git repo around. This is to protect against the use of relative paths - # like ../../CMakeLists.txt that would only work if you are in the repoo - $R_CMD_CHECK_DIR = "tmp-r-cmd-check" - New-Item -Path "C:\" -Name $R_CMD_CHECK_DIR -ItemType "directory" > $null - Move-Item -Path "$PKG_FILE_NAME" -Destination "C:\$R_CMD_CHECK_DIR\" > $null - cd "C:\$R_CMD_CHECK_DIR\" - } - - Write-Output "Running R CMD check" - if ($env:R_BUILD_TYPE -eq "cran") { - # CRAN packages must pass without --no-multiarch (build on 64-bit and 32-bit) - $check_args = "c('CMD', 'check', '--as-cran', '--run-donttest', '$PKG_FILE_NAME')" - } else { - $check_args = "c('CMD', 'check', '--no-multiarch', '--as-cran', '--run-donttest', '$PKG_FILE_NAME')" - } - Run-R-Code-Redirect-Stderr "result <- processx::run(command = 'R.exe', args = $check_args, echo = TRUE, windows_verbatim_args = FALSE, error_on_status = TRUE)" ; $check_succeeded = $? - - Write-Output "R CMD check build logs:" - $INSTALL_LOG_FILE_NAME = "lightgbm.Rcheck\00install.out" - Get-Content -Path "$INSTALL_LOG_FILE_NAME" - - Check-Output $check_succeeded - - Write-Output "Looking for issues with R CMD check results" - if (Get-Content "$LOG_FILE_NAME" | Select-String -Pattern "NOTE|WARNING|ERROR" -CaseSensitive -Quiet) { - echo "NOTEs, WARNINGs, or ERRORs have been found by R CMD check" - Check-Output $False - } - -} else { - $env:TMPDIR = $env:USERPROFILE # to avoid warnings about incremental builds inside a temp directory - $INSTALL_LOG_FILE_NAME = "$env:BUILD_SOURCESDIRECTORY\00install_out.txt" - Run-R-Code-Redirect-Stderr "source('build_r.R')" 1> $INSTALL_LOG_FILE_NAME ; $install_succeeded = $? - Write-Output "----- build and install logs -----" - Get-Content -Path "$INSTALL_LOG_FILE_NAME" - Write-Output "----- end of build and install logs -----" - Check-Output $install_succeeded - # some errors are not raised above, but can be found in the logs - if (Get-Content "$INSTALL_LOG_FILE_NAME" | Select-String -Pattern "ERROR" -CaseSensitive -Quiet) { - echo "ERRORs have been found installing lightgbm" - Check-Output $False - } -} - -# Checking that we actually got the expected compiler. The R package has some logic -# to fail back to MinGW if MSVC fails, but for CI builds we need to check that the correct -# compiler was used. -if ($env:R_BUILD_TYPE -eq "cmake") { - $checks = Select-String -Path "${INSTALL_LOG_FILE_NAME}" -Pattern "Check for working CXX compiler.*$env:COMPILER" - if ($checks.Matches.length -eq 0) { - Write-Output "The wrong compiler was used. Check the build logs." - Check-Output $False - } -} - -# Checking that we got the right toolchain for MinGW. If using MinGW, both -# MinGW and MSYS toolchains are supported -if (($env:COMPILER -eq "MINGW") -and ($env:R_BUILD_TYPE -eq "cmake")) { - $checks = Select-String -Path "${INSTALL_LOG_FILE_NAME}" -Pattern "Trying to build with.*$env:TOOLCHAIN" - if ($checks.Matches.length -eq 0) { - Write-Output "The wrong toolchain was used. Check the build logs." - Check-Output $False - } -} - -if ($env:COMPILER -eq "MSVC") { - Write-Output "Running tests with testthat.R" - cd R-package/tests - Run-R-Code-Redirect-Stderr "source('testthat.R')" ; Check-Output $? -} - -Write-Output "No issues were found checking the R package" diff --git a/.ci/test_windows.ps1 b/.ci/test_windows.ps1 deleted file mode 100644 index 20e7bf65..00000000 --- a/.ci/test_windows.ps1 +++ /dev/null @@ -1,115 +0,0 @@ -function Check-Output { - param( [bool]$success ) - if (!$success) { - $host.SetShouldExit(-1) - Exit -1 - } -} - -# unify environment variable for Azure DevOps and AppVeyor -if (Test-Path env:APPVEYOR) { - $env:APPVEYOR = "true" -} - -if ($env:TASK -eq "r-package") { - & $env:BUILD_SOURCESDIRECTORY\.ci\test_r_package_windows.ps1 ; Check-Output $? - Exit 0 -} - -if ($env:TASK -eq "cpp-tests") { - mkdir $env:BUILD_SOURCESDIRECTORY/build; cd $env:BUILD_SOURCESDIRECTORY/build - cmake -DBUILD_CPP_TEST=ON -DUSE_OPENMP=OFF -A x64 .. - cmake --build . --target testlightgbm --config Debug ; Check-Output $? - Start-Process -FilePath "./../Debug/testlightgbm.exe" -NoNewWindow -Wait ; Check-Output $? - Exit 0 -} - -# setup for Python -conda init powershell -conda activate -conda config --set always_yes yes --set changeps1 no -conda update -q -y conda -conda create -q -y -n $env:CONDA_ENV python=$env:PYTHON_VERSION ; Check-Output $? -if ($env:TASK -ne "bdist") { - conda activate $env:CONDA_ENV -} - -if ($env:TASK -eq "swig") { - $env:JAVA_HOME = $env:JAVA_HOME_8_X64 # there is pre-installed Zulu OpenJDK-8 somewhere - $ProgressPreference = "SilentlyContinue" # progress bar bug extremely slows down download speed - Invoke-WebRequest -Uri "https://github.com/microsoft/LightGBM/releases/download/v2.0.12/swigwin-4.0.2.zip" -OutFile $env:BUILD_SOURCESDIRECTORY/swig/swigwin.zip -UserAgent "NativeHost" - Add-Type -AssemblyName System.IO.Compression.FileSystem - [System.IO.Compression.ZipFile]::ExtractToDirectory("$env:BUILD_SOURCESDIRECTORY/swig/swigwin.zip", "$env:BUILD_SOURCESDIRECTORY/swig") - $env:PATH += ";$env:BUILD_SOURCESDIRECTORY/swig/swigwin-4.0.2" - mkdir $env:BUILD_SOURCESDIRECTORY/build; cd $env:BUILD_SOURCESDIRECTORY/build - cmake -A x64 -DUSE_SWIG=ON .. ; cmake --build . --target ALL_BUILD --config Release ; Check-Output $? - if ($env:AZURE -eq "true") { - cp $env:BUILD_SOURCESDIRECTORY/build/lightgbmlib.jar $env:BUILD_ARTIFACTSTAGINGDIRECTORY/lightgbmlib_win.jar - } - Exit 0 -} - -conda install -q -y -n $env:CONDA_ENV joblib matplotlib numpy pandas psutil pytest python-graphviz scikit-learn scipy ; Check-Output $? - -if ($env:TASK -eq "regular") { - mkdir $env:BUILD_SOURCESDIRECTORY/build; cd $env:BUILD_SOURCESDIRECTORY/build - cmake -A x64 .. ; cmake --build . --target ALL_BUILD --config Release ; Check-Output $? - cd $env:BUILD_SOURCESDIRECTORY/python-package - python setup.py install --precompile ; Check-Output $? - cp $env:BUILD_SOURCESDIRECTORY/Release/lib_lightgbm.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY - cp $env:BUILD_SOURCESDIRECTORY/Release/lightgbm.exe $env:BUILD_ARTIFACTSTAGINGDIRECTORY -} -elseif ($env:TASK -eq "sdist") { - cd $env:BUILD_SOURCESDIRECTORY/python-package - python setup.py sdist --formats gztar ; Check-Output $? - cd dist; pip install @(Get-ChildItem *.gz) -v ; Check-Output $? -} -elseif ($env:TASK -eq "bdist") { - # Import the Chocolatey profile module so that the RefreshEnv command - # invoked below properly updates the current PowerShell session environment. - $module = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" - Import-Module "$module" ; Check-Output $? - RefreshEnv - - Write-Output "Current OpenCL drivers:" - Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenCL\Vendors - - conda activate $env:CONDA_ENV - cd $env:BUILD_SOURCESDIRECTORY/python-package - python setup.py bdist_wheel --integrated-opencl --plat-name=win-amd64 --python-tag py3 ; Check-Output $? - cd dist; pip install --user @(Get-ChildItem *.whl) ; Check-Output $? - cp @(Get-ChildItem *.whl) $env:BUILD_ARTIFACTSTAGINGDIRECTORY -} elseif (($env:APPVEYOR -eq "true") -and ($env:TASK -eq "python")) { - cd $env:BUILD_SOURCESDIRECTORY\python-package - if ($env:COMPILER -eq "MINGW") { - python setup.py install --mingw ; Check-Output $? - } else { - python setup.py install ; Check-Output $? - } -} - -if (($env:TASK -eq "sdist") -or (($env:APPVEYOR -eq "true") -and ($env:TASK -eq "python"))) { - # cannot test C API with "sdist" task - $tests = $env:BUILD_SOURCESDIRECTORY + "/tests/python_package_test" -} else { - $tests = $env:BUILD_SOURCESDIRECTORY + "/tests" -} -if ($env:TASK -eq "bdist") { - # Make sure we can do both CPU and GPU; see tests/python_package_test/test_dual.py - $env:LIGHTGBM_TEST_DUAL_CPU_GPU = "1" -} - -pytest $tests ; Check-Output $? - -if (($env:TASK -eq "regular") -or (($env:APPVEYOR -eq "true") -and ($env:TASK -eq "python"))) { - cd $env:BUILD_SOURCESDIRECTORY/examples/python-guide - @("import matplotlib", "matplotlib.use('Agg')") + (Get-Content "plot_example.py") | Set-Content "plot_example.py" - (Get-Content "plot_example.py").replace('graph.render(view=True)', 'graph.render(view=False)') | Set-Content "plot_example.py" # prevent interactive window mode - foreach ($file in @(Get-ChildItem *.py)) { - @("import sys, warnings", "warnings.showwarning = lambda message, category, filename, lineno, file=None, line=None: sys.stdout.write(warnings.formatwarning(message, category, filename, lineno, line))") + (Get-Content $file) | Set-Content $file - python $file ; Check-Output $? - } # run all examples - cd $env:BUILD_SOURCESDIRECTORY/examples/python-guide/notebooks - conda install -q -y -n $env:CONDA_ENV ipywidgets notebook - jupyter nbconvert --ExecutePreprocessor.timeout=180 --to notebook --execute --inplace *.ipynb ; Check-Output $? # run all notebooks -} diff --git a/.ci/trigger_dispatch_run.sh b/.ci/trigger_dispatch_run.sh deleted file mode 100755 index 040d6e9a..00000000 --- a/.ci/trigger_dispatch_run.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -# -# [description] -# Trigger manual workflow run by a dispatch event. -# -# [usage] -# trigger_dispatch_run.sh -# -# PR_URL: URL of pull request from which dispatch is triggering. -# -# COMMENT_ID: ID of comment that is triggering a dispatch. -# -# DISPATCH_NAME: Name of a dispatch to be triggered. - -set -e - -if [ -z "$GITHUB_ACTIONS" ]; then - echo "Must be run inside GitHub Actions CI" - exit -1 -fi - -if [ $# -ne 3 ]; then - echo "Usage: $0 " - exit -1 -fi - -pr_url=$1 -comment_id=$2 -dispatch_name=$3 - -pr=$( - curl -sL \ - -H "Accept: application/vnd.github.v3+json" \ - -H "Authorization: token $SECRETS_WORKFLOW" \ - "$pr_url" -) -data=$( - jq -n \ - --arg event_type "$dispatch_name" \ - --arg pr_number "$(echo $pr | jq '.number')" \ - --arg pr_sha "$(echo $pr | jq '.head.sha')" \ - --arg pr_branch "$(echo $pr | jq '.head.ref')" \ - --arg comment_number "$comment_id" \ - '{"event_type":$event_type,"client_payload":{"pr_number":$pr_number,"pr_sha":$pr_sha,"pr_branch":$pr_branch,"comment_number":$comment_number}}' -) -curl -sL \ - -X POST \ - -H "Accept: application/vnd.github.v3+json" \ - -H "Authorization: token $SECRETS_WORKFLOW" \ - -d "$data" \ - "${GITHUB_API_URL}/repos/microsoft/LightGBM/dispatches" diff --git a/.github/no-response.yml b/.github/no-response.yml deleted file mode 100644 index dbfcf698..00000000 --- a/.github/no-response.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Configuration for probot-no-response - https://github.com/probot/no-response - -# Number of days of inactivity before an Issue is closed for lack of response -daysUntilClose: 30 -# Label requiring a response -responseRequiredLabel: awaiting response -# Comment to post when closing an Issue for lack of response. Set to `false` to disable -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. Thank you for taking the time to improve LightGBM! diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index 46827811..00000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,20 +0,0 @@ -name-template: 'v$NEXT_PATCH_VERSION' -tag-template: 'v$NEXT_PATCH_VERSION' -categories: - - title: '💡 New Features' - label: 'feature' - - title: '🔨 Breaking' - label: 'breaking' - - title: '🚀 Efficiency Improvement' - label: 'efficiency' - - title: '🐛 Bug Fixes' - label: 'fix' - - title: '📖 Documentation' - label: 'doc' - - title: '🧰 Maintenance' - label: 'maintenance' -change-template: '- $TITLE @$AUTHOR (#$NUMBER)' -template: | - ## Changes - - $CHANGES diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index 851c3f7e..994bfe61 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -43,43 +43,10 @@ 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: Checkout repository - uses: actions/checkout@v2.3.4 - with: - fetch-depth: 5 - submodules: true - - name: Install packages - shell: bash - run: | - Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'roxygen2', 'testthat'), repos = 'https://cran.r-project.org', 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-successful: # https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert runs-on: ubuntu-latest - needs: [test, r-check-docs] + needs: [test] steps: - name: Note that all tests succeeded run: echo "🎉" diff --git a/README.md b/README.md index 1ad09081..ddef266a 100644 --- a/README.md +++ b/README.md @@ -268,3 +268,4 @@ For commercial uses of FairGBM please contact . ``` The paper is publicly available at this [arXiv link](https://arxiv.org/abs/2209.07850). +