Speedup R test on github. (#8388)
This commit is contained in:
parent
786aa27134
commit
a2593e60bf
2
.github/workflows/r_tests.yml
vendored
2
.github/workflows/r_tests.yml
vendored
@ -52,7 +52,7 @@ jobs:
|
|||||||
- name: Run lintr
|
- name: Run lintr
|
||||||
run: |
|
run: |
|
||||||
cd R-package
|
cd R-package
|
||||||
R CMD INSTALL .
|
MAKE="make -j$(nproc)" R CMD INSTALL .
|
||||||
# Disable lintr errors for now: https://github.com/dmlc/xgboost/issues/8012
|
# Disable lintr errors for now: https://github.com/dmlc/xgboost/issues/8012
|
||||||
Rscript tests/helper_scripts/run_lint.R || true
|
Rscript tests/helper_scripts/run_lint.R || true
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from time import time
|
||||||
|
|
||||||
from test_utils import DirectoryExcursion
|
from test_utils import DirectoryExcursion
|
||||||
|
|
||||||
ROOT = os.path.normpath(
|
ROOT = os.path.normpath(
|
||||||
@ -20,7 +22,7 @@ def test_with_autotools(args):
|
|||||||
CC = os.path.join(mingw_bin, 'gcc.exe')
|
CC = os.path.join(mingw_bin, 'gcc.exe')
|
||||||
cmd = ['R.exe', 'CMD', 'INSTALL', str(os.path.curdir)]
|
cmd = ['R.exe', 'CMD', 'INSTALL', str(os.path.curdir)]
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
env.update({'CC': CC, 'CXX': CXX})
|
env.update({'CC': CC, 'CXX': CXX, "MAKE": "make -j$(nproc)"})
|
||||||
subprocess.check_call(cmd, env=env)
|
subprocess.check_call(cmd, env=env)
|
||||||
subprocess.check_call([
|
subprocess.check_call([
|
||||||
'R.exe', '-q', '-e',
|
'R.exe', '-q', '-e',
|
||||||
@ -69,11 +71,13 @@ def test_with_cmake(args):
|
|||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
def main(args):
|
def main(args: argparse.Namespace) -> None:
|
||||||
|
start = time()
|
||||||
if args.build_tool == 'autotools':
|
if args.build_tool == 'autotools':
|
||||||
test_with_autotools(args)
|
test_with_autotools(args)
|
||||||
else:
|
else:
|
||||||
test_with_cmake(args)
|
test_with_cmake(args)
|
||||||
|
print("Duration:", time() - start)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user