Skip to content

Commit

Permalink
simplify GLCI (#6585)
Browse files Browse the repository at this point in the history
* remove hard code rtools

* use powershell syntax

* add debug

* rewrite more powershell

* move new variable to script step

* persist rtools_home

* move Rscript debug

* fix typo

* remove debug

* add comments
  • Loading branch information
ben-schwen authored Oct 20, 2024
1 parent 200d657 commit 058dd4d
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,12 @@ variables:
TZ: "UTC" ## to avoid 'Failed to create bus connection' from timedatectl via Sys.timezone() on Docker with R 3.4.
## Setting TZ for all GLCI jobs to isolate them from timezone. We could have a new GLCI job to test under
## a non-UTC timezone, although, that's what we do routinely in dev.
R_REL_VERSION: "4.4"
R_REL_VERSION: "4.4" # only raise when RTOOLS for REL is available
R_REL_WIN_BIN: "https://cloud.r-project.org/bin/windows/base/old/4.4.1/R-4.4.1-win.exe"
RTOOLS_REL_BIN: "https://cloud.r-project.org/bin/windows/Rtools/rtools44/files/rtools44-6104-6039.exe"
RTOOLS44_HOME: "/c/rtools" # needed for finding gcc #6552
R_DEV_VERSION: "4.5"
R_DEV_WIN_BIN: "https://cloud.r-project.org/bin/windows/base/R-devel-win.exe"
RTOOLS_DEV_BIN: "https://cloud.r-project.org/bin/windows/Rtools/rtools44/files/rtools44-6104-6039.exe" # dev uses same rtools as release
R_OLD_VERSION: "4.3"
R_OLD_WIN_BIN: "https://cloud.r-project.org/bin/windows/base/old/4.3.3/R-4.3.3-win.exe"
RTOOLS_OLD_BIN: "https://cloud.r-project.org/bin/windows/Rtools/rtools43/files/rtools43-5958-5975.exe"
RTOOLS43_HOME: "/c/rtools" # needed for finding gcc #6552

stages:
- dependencies
Expand Down Expand Up @@ -219,9 +214,13 @@ test-lin-ancient-cran:
tags:
- saas-windows-medium-amd64
before_script:
- curl.exe -s -o ../R-win.exe $R_BIN --fail; if (!(Test-Path -Path ..\R-win.exe)) {Write-Error "R-win.exe not found, download failed?"}
- Invoke-WebRequest -Uri $R_BIN -OutFile ../R-win.exe -ErrorAction Stop; if (!(Test-Path -Path ..\R-win.exe)) {Write-Error "R-win.exe not found, download failed?"}
- Start-Process -FilePath ..\R-win.exe -ArgumentList "/VERYSILENT /DIR=C:\R" -NoNewWindow -Wait
- curl.exe -s -o ../rtools.exe $RTOOLS_BIN --fail; if (!(Test-Path -Path ..\rtools.exe)) {Write-Error "rtools.exe not found, download failed?"}
- $VERSION = $RTOOLS_VERSION -replace '\.', ''
# persist RTOOLSXX_HOME="/c/rtools" which is needed for finding gcc #6552
- Add-Content -Path ".\.Renviron" -Value "RTOOLS${VERSION}_HOME='/c/rtools'"
- $RTOOLS_BIN="https://github.com/r-hub/rtools${VERSION}/releases/download/latest/rtools${VERSION}.exe"
- Invoke-WebRequest -Uri $RTOOLS_BIN -OutFile ../rtools.exe -ErrorAction Stop; if (!(Test-Path -Path ..\rtools.exe)) {Write-Error "rtools.exe not found, download failed?"}
- Start-Process -FilePath ..\rtools.exe -ArgumentList "/VERYSILENT /DIR=C:\rtools" -NoNewWindow -Wait
- $env:PATH = "C:\R\bin;C:\rtools\usr\bin;$env:PATH"
- Rscript.exe -e "source('.ci/ci.R'); install.packages(dcf.dependencies('DESCRIPTION', which='all'), repos=file.path('file://',getwd(),'bus/mirror-packages/cran'), quiet=TRUE)"
Expand All @@ -244,27 +243,24 @@ test-lin-ancient-cran:
test-win-rel:
<<: *test-win
variables:
R_VERSION: "$R_REL_VERSION"
R_BIN: "$R_REL_WIN_BIN"
RTOOLS_BIN: "$RTOOLS_REL_BIN"
RTOOLS_VERSION: "$R_REL_VERSION"

## R-devel on Windows
# test and build binaries
test-win-dev:
<<: *test-win
variables:
R_VERSION: "$R_DEV_VERSION"
R_BIN: "$R_DEV_WIN_BIN"
RTOOLS_BIN: "$RTOOLS_DEV_BIN"
RTOOLS_VERSION: "$R_REL_VERSION"

## R-oldrel on Windows
# test and build binaries
test-win-old:
<<: *test-win
variables:
R_VERSION: "$R_OLD_VERSION"
R_BIN: "$R_OLD_WIN_BIN"
RTOOLS_BIN: "$RTOOLS_OLD_BIN"
RTOOLS_VERSION: "$R_OLD_VERSION"

.test-mac-template: &test-mac
<<: *test
Expand Down

0 comments on commit 058dd4d

Please sign in to comment.