未验证 提交 b7371fa5 编写于 作者: Z Zhou Wei 提交者: GitHub

judge whether remove build dir to accelerate compile,test=develop (#27334)

上级 18f2ea66
......@@ -20,14 +20,51 @@ rem Paddle CI Task On Windows Platform
rem =================================================
rem -------clean up environment-----------
wmic process where name="op_function_generator.exe" call terminate 2>NUL
set work_dir=%cd%
mkdir build
wmic process where name="op_function_generator.exe" call terminate 2>NUL
rem ------initialize common variable------
if not defined CUDA_TOOLKIT_ROOT_DIR set CUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0"
if not defined BRANCH set BRANCH=develop
if not defined WITH_MKL set WITH_MKL=ON
if not defined WITH_GPU set WITH_GPU=OFF
if not defined WITH_AVX set WITH_AVX=ON
if not defined WITH_TESTING set WITH_TESTING=ON
if not defined WITH_PYTHON set WITH_PYTHON=ON
if not defined ON_INFER set ON_INFER=ON
if not defined WITH_INFERENCE_API_TEST set WITH_INFERENCE_API_TEST=ON
if not defined WITH_CACHE set WITH_CACHE=ON
if not defined WITH_TPCACHE set WITH_TPCACHE=ON
rem -------set cache build work directory-----------
if "%WITH_CACHE%"=="OFF" (
rmdir build /s/q
goto :mkbuild
)
for /F %%# in ('wmic os get localdatetime^|findstr 20') do set datetime=%%#
set day_now=%datetime:~6,2%
set day_before=-1
set /p day_before=<day.txt
if %day_now% NEQ %day_before% (
echo %day_now% > day.txt
type day.txt
rmdir build /s/q
)
git diff origin/develop --stat --name-only | findstr "cmake CMakeLists.txt paddle_build.bat"
if %ERRORLEVEL% EQU 0 (
rmdir build /s/q
)
:mkbuild
if not exist build (
mkdir build
)
cd /d build
tree .
dir .
dir paddle\fluid\pybind\Release
rem ------initialize the virtual environment------
rem ------initialize the python environment------
if not defined PYTHON_ROOT set PYTHON_ROOT=C:\Python37
set PATH=%PYTHON_ROOT%;%PYTHON_ROOT%\Scripts;%PATH%
......@@ -38,7 +75,7 @@ rem %PYTHON_EXECUTABLE% -m pip install virtualenv
rem %PYTHON_EXECUTABLE% -m virtualenv paddle_winci
rem call paddle_winci\Scripts\activate.bat
rem ------pre install requirement----------
rem ------pre install python requirement----------
where python
where pip
pip install --upgrade pip --user
......@@ -62,16 +99,6 @@ set CLCACHE_OBJECT_CACHE_TIMEOUT_MS=1000000
:: set maximum cache size to 20G
clcache.exe -M 21474836480
rem ------initialize common variable------
if not defined CUDA_TOOLKIT_ROOT_DIR set CUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0"
if not defined BRANCH set BRANCH=develop
if not defined WITH_AVX set WITH_AVX=ON
if not defined WITH_TESTING set WITH_TESTING=ON
if not defined WITH_PYTHON set WITH_PYTHON=ON
if not defined ON_INFER set ON_INFER=ON
if not defined WITH_INFERENCE_API_TEST set WITH_INFERENCE_API_TEST=ON
if not defined WITH_TPCACHE set WITH_TPCACHE=ON
rem ------set cache third_party------
set cache_dir=%work_dir:Paddle=cache%
dir %cache_dir%
......@@ -418,6 +445,7 @@ taskkill /f /im rc.exe 2>NUL
wmic process where name="op_function_generator.exe" call terminate 2>NUL
taskkill /f /im python.exe 2>NUL
call paddle_winci\Scripts\deactivate.bat 2>NUL
del %PADDLE_WHL_FILE_WIN%
taskkill /f /im python.exe 2>NUL
echo Windows CI run successfully!
exit /b 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册