Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
dbc3d05c
Unverified
Commit
dbc3d05c
authored
Mar 31, 2020
by
James Lamb
Committed by
GitHub
Mar 30, 2020
Browse files
[R-package] [ci] Add option to skip installation in build_r.R (#2957)
Co-authored-by:
Nikita Titov
<
nekit94-08@mail.ru
>
parent
e6de39a7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
.ci/test_r_package.sh
.ci/test_r_package.sh
+2
-2
build_r.R
build_r.R
+8
-1
No files found.
.ci/test_r_package.sh
View file @
dbc3d05c
...
...
@@ -69,10 +69,10 @@ packages="c('data.table', 'jsonlite', 'Matrix', 'R6', 'testthat')"
if
[[
$OS_NAME
==
"macos"
]]
;
then
packages+
=
", type = 'binary'"
fi
Rscript
--vanilla
-e
"install.packages(
${
packages
}
, repos = '
${
CRAN_MIRROR
}
', lib = '
${
R_LIB_PATH
}
')"
||
exit
-1
Rscript
--vanilla
-e
"install.packages(
${
packages
}
, repos = '
${
CRAN_MIRROR
}
', lib = '
${
R_LIB_PATH
}
'
, dependencies = c('Depends', 'Imports', 'LinkingTo')
)"
||
exit
-1
cd
${
BUILD_DIRECTORY
}
Rscript build_r.R
||
exit
-1
Rscript build_r.R
--skip-install
||
exit
-1
PKG_TARBALL
=
"lightgbm_
${
LGB_VER
}
.tar.gz"
LOG_FILE_NAME
=
"lightgbm.Rcheck/00check.log"
...
...
build_r.R
View file @
dbc3d05c
...
...
@@ -5,6 +5,9 @@
# Sys.setenv("CXX" = "/usr/local/bin/g++-8")
# Sys.setenv("CC" = "/usr/local/bin/gcc-8")
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
# breaks. Let's fix that
.handle_result
<-
function
(
res
)
{
...
...
@@ -86,4 +89,8 @@ version <- gsub(
tarball
<-
file.path
(
getwd
(),
sprintf
(
"lightgbm_%s.tar.gz"
,
version
))
cmd
<-
sprintf
(
"R CMD INSTALL %s --no-multiarch --with-keep.source"
,
tarball
)
.run_shell_command
(
cmd
)
if
(
INSTALL_AFTER_BUILD
)
{
.run_shell_command
(
cmd
)
}
else
{
print
(
sprintf
(
"Skipping installation. Install the package with command '%s'"
,
cmd
))
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment