diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 6a39f0b83542..3021a1ecadcd 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -73,13 +73,14 @@ $PKG_FILE_NAME = Get-Item *.tar.gz $LOG_FILE_NAME = "lightgbm.Rcheck/00check.log" Write-Output "Running R CMD check" -$check_flags = "--as-cran --no-multiarch" +$env:_R_CHECK_FORCE_SUGGESTS_=0 if ($env:AZURE -eq "true") { - $check_flags = "--no-multiarch --no-manual --ignore-vignettes" + Write-Output "Running R CMD check without checking documentation" + R.exe CMD check --no-multiarch --no-manual --ignore-vignettes ; Check-Output $? +} else { + Write-Output "Running R CMD check as CRAN" + R.exe CMD check --no-multiarch --as-cran ${PKG_FILE_NAME} ; Check-Output $? } -Write-Output "using check flags '$check_flags'" -$env:_R_CHECK_FORCE_SUGGESTS_=0 -R.exe CMD check "${PKG_FILE_NAME}" $check_flags ; Check-Output $? Write-Output "Looking for issues with R CMD check results" if (Get-Content "$LOG_FILE_NAME" | Select-String -Pattern "WARNING" -Quiet) { diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 879a039caf90..81fbc1c38366 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -24,6 +24,8 @@ jobs: strategy: maxParallel: 6 matrix: + r_package: + TASK: r-package regular: TASK: regular sdist: @@ -42,8 +44,6 @@ jobs: TASK: gpu METHOD: source PYTHON_VERSION: 3.6 - r_package: - TASK: r-package steps: - script: | echo "##vso[task.setvariable variable=HOME_DIRECTORY]$AGENT_HOMEDIRECTORY" @@ -78,6 +78,8 @@ jobs: strategy: maxParallel: 3 matrix: + r_package: + TASK: r-package regular: TASK: regular PYTHON_VERSION: 3.6 @@ -86,8 +88,6 @@ jobs: PYTHON_VERSION: 3.5 bdist: TASK: bdist - r_package: - TASK: r-package steps: - script: | echo "##vso[task.setvariable variable=HOME_DIRECTORY]$AGENT_HOMEDIRECTORY" @@ -126,11 +126,11 @@ jobs: TASK: regular PYTHON_VERSION: 3.7 sdist: - TASK: sdist - PYTHON_VERSION: 2.7 + TASK: sdist + PYTHON_VERSION: 2.7 bdist: - TASK: bdist - PYTHON_VERSION: 3.5 + TASK: bdist + PYTHON_VERSION: 3.5 steps: - powershell: | Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" diff --git a/build_r.R b/build_r.R index 1ca97d70d397..29a4d3cc382d 100644 --- a/build_r.R +++ b/build_r.R @@ -5,7 +5,7 @@ # Sys.setenv("CXX" = "/usr/local/bin/g++-8") # Sys.setenv("CC" = "/usr/local/bin/gcc-8") -args <- commandArgs(trailingOnly=TRUE) +args <- commandArgs(trailingOnly = TRUE) INSTALL_AFTER_BUILD <- !("--skip-install" %in% args) # R returns FALSE (not a non-zero exit code) if a file copy operation @@ -89,7 +89,7 @@ version <- gsub( tarball <- file.path(getwd(), sprintf("lightgbm_%s.tar.gz", version)) cmd <- sprintf("R CMD INSTALL %s --no-multiarch --with-keep.source", tarball) -if (INSTALL_AFTER_BUILD){ +if (INSTALL_AFTER_BUILD) { .run_shell_command(cmd) } else { print(sprintf("Skipping installation. Install the package with command '%s'", cmd))