From 25c57d3d36332d8d803338ef175b11b734db80a3 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 7 Mar 2021 23:55:16 -0600 Subject: [PATCH 1/5] [ci] add CMake + R 3.6 test back (fixes #3469) --- .ci/test_r_package_windows.ps1 | 22 ++++++++++++++++++++++ .github/workflows/r_package.yml | 6 ++++++ 2 files changed, 28 insertions(+) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 75bbf8f634ba..72b9d0cb5ecb 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -28,6 +28,24 @@ function Run-R-Code-Redirect-Stderr { Rscript --vanilla -e $decorated_code } +# Remove all items matching some pattern from PATH environment variable +function Remove-From-Path { + param( + [string]$item_to_remove + ) + $env:path = ($env:path.Split(';') | Where-Object { $_ -notmatch "$item_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.*" + # Get details needed for installing R components # # NOTES: @@ -95,6 +113,10 @@ Write-Output "Installing Rtools" ./Rtools.exe /VERYSILENT /SUPPRESSMSGBOXES /DIR=$RTOOLS_INSTALL_PATH ; Check-Output $? Write-Output "Done installing Rtools" +# wait for all Rtools files to be written +Write-Output "Sleeping to allow Rtools install to finish" +Start-Sleep -Seconds 60 + 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')" ; Check-Output $? diff --git a/.github/workflows/r_package.yml b/.github/workflows/r_package.yml index 54b2798fa40a..d8015f72b09d 100644 --- a/.github/workflows/r_package.yml +++ b/.github/workflows/r_package.yml @@ -60,6 +60,12 @@ jobs: compiler: clang r_version: 4.0 build_type: cmake + - os: windows-latest + task: r-package + compiler: MINGW + toolchain: MINGW + r_version: 3.6 + build_type: cmake - os: windows-latest task: r-package compiler: MINGW From 558784a86993c95b799867315f16537f76ac722e Mon Sep 17 00:00:00 2001 From: James Lamb Date: Mon, 8 Mar 2021 14:12:29 -0600 Subject: [PATCH 2/5] Apply suggestions from code review Co-authored-by: Nikita Titov --- .ci/test_r_package_windows.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 72b9d0cb5ecb..3ea2fd32176f 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -33,7 +33,7 @@ function Remove-From-Path { param( [string]$item_to_remove ) - $env:path = ($env:path.Split(';') | Where-Object { $_ -notmatch "$item_to_remove" }) -join ';' + $env:PATH = ($env:PATH.Split(';') | Where-Object { $_ -notmatch "$item_to_remove" }) -join ';' } # remove some details that exist in the GitHub Actions images which might From 6f0b8762f4a65f57e46c813eca610fab68793d39 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Mon, 8 Mar 2021 14:16:52 -0600 Subject: [PATCH 3/5] Update .ci/test_r_package_windows.ps1 --- .ci/test_r_package_windows.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 3ea2fd32176f..61caeb877e26 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -31,9 +31,9 @@ function Run-R-Code-Redirect-Stderr { # Remove all items matching some pattern from PATH environment variable function Remove-From-Path { param( - [string]$item_to_remove + [string]$pattern_to_remove ) - $env:PATH = ($env:PATH.Split(';') | Where-Object { $_ -notmatch "$item_to_remove" }) -join ';' + $env:PATH = ($env:PATH.Split(';') | Where-Object { $_ -notmatch "$pattern_to_remove" }) -join ';' } # remove some details that exist in the GitHub Actions images which might From 0d67e7e78a9a5deb5e83603a897822da3326a9e6 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Mon, 8 Mar 2021 22:04:03 -0600 Subject: [PATCH 4/5] -Wait and remove rtools40 --- .ci/test_r_package_windows.ps1 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 61caeb877e26..40a5b81f7819 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -46,6 +46,8 @@ 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: @@ -110,13 +112,9 @@ Start-Process -FilePath R-win.exe -NoNewWindow -Wait -ArgumentList "/VERYSILENT Write-Output "Done installing R" Write-Output "Installing Rtools" -./Rtools.exe /VERYSILENT /SUPPRESSMSGBOXES /DIR=$RTOOLS_INSTALL_PATH ; Check-Output $? +Start-Process -FilePath Rtools.exe -NoNewWindow -Wait -ArgumentList "/VERYSILENT /SUPPRESSMSGBOXES /DIR=$RTOOLS_INSTALL_PATH" ; Check-Output $? Write-Output "Done installing Rtools" -# wait for all Rtools files to be written -Write-Output "Sleeping to allow Rtools install to finish" -Start-Sleep -Seconds 60 - 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')" ; Check-Output $? From aff80c94bd2a29a19e86ef3d276bb3d0897ee962 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Mon, 8 Mar 2021 22:42:19 -0600 Subject: [PATCH 5/5] empty commit