Skip to content
Snippets Groups Projects
Commit ea7387ec authored by Astre Benjamin's avatar Astre Benjamin
Browse files

#9 try for windows R build package

parent bcca7f4c
No related branches found
No related tags found
1 merge request!4Many improvments
Pipeline #79459 passed with warnings
......@@ -265,11 +265,11 @@ include:
paths:
- ${R_PACKAGE_ROOT_RELATIVE_PATH}/build/bin/*.tar.gz
# TODO voir pour utiliser les cache, install de deps, optionsCi(), etc.
# Can't reuse other jobs because Powershell doesn't allow the use of variable as command :(
# TODO ne fonctionne pas en version actuelle (voir issue #9), d'où le allow_failure: true
.R-build-windows-binary-package:
tags:
- windows-cmd-shell
- windows-powershell
- stable
image: null
extends:
......@@ -278,20 +278,46 @@ include:
- .R-install-package-dependencies-withCache
- .check-git-changes-status-base
variables:
# Other than 1 value disable package update at beginning of all template jobs
# (1 may be the default value, but this has a very expensive time cost on the CI)
R_DO_PACKAGE_UPDATE: 0
# MUST be redefined if your package folder isn't the root directory
# of the project repository
R_PACKAGE_ROOT_RELATIVE_PATH: .
# This generally doesn't need to be redefined
R_PACKAGE_ROOT_ABSOLUTE_PATH: $CI_PROJECT_DIR\$R_PACKAGE_ROOT_RELATIVE_PATH
R_PACKAGE_ROOT_ABSOLUTE_PATH: ${CI_PROJECT_DIR}\${R_PACKAGE_ROOT_RELATIVE_PATH}
LOCAL_R_LIBS_USER: ci/lib
R_LIBS_USER: "${CI_PROJECT_DIR}/${LOCAL_R_LIBS_USER}"
R_LIBS: "${R_LIBS_USER}:/usr/local/lib/R/site-library:/usr/local/lib/R/library"
before_script:
- echo $R_LIBS_USER
- echo $R_LIBS
- Rscript -e 'if (!dir.exists(Sys.getenv("R_LIBS_USER"))) {dir.create(Sys.getenv("R_LIBS_USER"), recursive = TRUE)}'
- Rscript -e '.libPaths()'
- echo "Installing rlang package..."
- Rscript -e 'utils::install.packages(pkgs = "rlang", repos = "https://cloud.r-project.org")'
- echo "Installing devtools package..."
- Rscript -e 'if (!rlang::is_installed(pkg = "devtools")) {utils::install.packages(pkgs = "devtools", repos = "https://cloud.r-project.org")}'
- echo "Installing citoolsr package..."
- Rscript -e 'devtools::install_gitlab(repo = "urep/dev_utils/r_utils/citoolsr", host = "https://forgemia.inra.fr")'
script:
- cd $R_PACKAGE_ROOT_ABSOLUTE_PATH
- !reference [.R-install-package-dependencies-withCache, script]
- cd ${R_PACKAGE_ROOT_ABSOLUTE_PATH}
- Rscript -e 'citoolsr::updatePackages(doUpdate = Sys.getenv("R_DO_PACKAGE_UPDATE"))'
- Rscript -e 'citoolsr::installDepsWithErrManagementCi(doUpgrades = TRUE, warningsAsErrors = TRUE, errorExpected = Sys.getenv("TEST_ERROR"))'
- mkdir ${R_PACKAGE_ROOT_ABSOLUTE_PATH}
- mkdir ${R_PACKAGE_ROOT_ABSOLUTE_PATH}/build
- mkdir ${R_PACKAGE_ROOT_ABSOLUTE_PATH}/build/bin
- echo '*** Build package... ***'
# Build binary package
- $R_RUN_CODE_COMMAND 'citoolsr::setOptionsForCi(); devtools::build(path = file.path(Sys.getenv("R_PACKAGE_ROOT_ABSOLUTE_PATH"), "build", "bin"), binary = TRUE)'
- Rscript -e 'citoolsr::setOptionsForCi(); devtools::build(path = file.path(Sys.getenv("R_PACKAGE_ROOT_ABSOLUTE_PATH"), "build", "bin"), binary = TRUE)'
- echo "Checking if all is correctly managed with git (no versioned item modified, no not versioned item, etc)..."
- !reference [.check-git-changes-status-base, script]
artifacts:
paths:
- ${R_PACKAGE_ROOT_RELATIVE_PATH}/build/bin/*.zip
cache:
- key: R-installed-packages-cache
paths:
- "${LOCAL_R_LIBS_USER}"
policy: pull-push
allow_failure: true
......@@ -201,7 +201,6 @@ Test runner clt-dgilmour-p Windows PowerShell:
# Allow failure because this PC is not always connected
allow_failure: true
# TODO ne fonctionne pas en version actuelle (voir issue #9)
Test runner clt-dgilmour-p Windows PowerShell R available:
extends:
- .rules-template
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment