Fix R package build on CI. (#8445)

Co-authored-by: Hyunsu Cho <chohyu01@cs.washington.edu>
This commit is contained in:
Jiaming Yuan
2022-11-09 12:18:36 +08:00
committed by GitHub
parent a83748eb45
commit 0252d504d8
5 changed files with 20 additions and 17 deletions

View File

@@ -10,7 +10,7 @@ fi
commit_hash="$1"
make Rpack
python tests/ci_build/test_r_package.py --task=pack
mv xgboost/ xgboost_rpack/
mkdir build

View File

@@ -9,8 +9,11 @@ then
fi
commit_hash="$1"
# Clear all positional args
set --
MAKE="/c/Rtools/bin/make" /c/Rtools/bin/make Rpack
source activate
python tests/ci_build/test_r_package.py --task=pack
mv xgboost/ xgboost_rpack/
mkdir build
@@ -31,4 +34,4 @@ echo 'all:' > xgboost_rpack/src/Makefile
echo 'all:' > xgboost_rpack/src/Makefile.win
mv xgboost_rpack/ xgboost/
/c/Rtools/bin/tar -cvf xgboost_r_gpu_win64_${commit_hash}.tar xgboost/
/c/Rtools/bin/gzip -9c xgboost_r_gpu_win64_${commit_hash}.tar > xgboost_r_gpu_win64_${commit_hash}.tar.gz
/c/Rtools/bin/gzip -9c xgboost_r_gpu_win64_${commit_hash}.tar > xgboost_r_gpu_win64_${commit_hash}.tar.gz

View File

@@ -251,7 +251,9 @@ def test_with_cmake(args: argparse.Namespace) -> None:
@record_time
def main(args: argparse.Namespace) -> None:
if args.task == "build":
if args.task == "pack":
pack_rpackage()
elif args.task == "build":
src_dir = pack_rpackage()
build_rpackage(src_dir)
elif args.task == "doc":
@@ -280,7 +282,7 @@ if __name__ == "__main__":
parser.add_argument(
"--task",
type=str,
choices=["build", "check", "doc"],
choices=["pack", "build", "check", "doc"],
default="check",
required=False,
)