From e5059a5dffed78d02203123822d8371cd4cdbb55 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 9 Nov 2020 17:52:33 +1000 Subject: [PATCH] update Windows CI --- .bazelrc | 2 ++ scripts/windows-ci.bat | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100755 scripts/windows-ci.bat diff --git a/.bazelrc b/.bazelrc index 1eaa7e670..9ba7bbb55 100644 --- a/.bazelrc +++ b/.bazelrc @@ -25,4 +25,6 @@ build --incompatible_default_to_explicit_init_py # faster for .ui file generation, but may sacrifice correctness #--genrule_strategy=standalone +build:ci --show_timestamps --isatty=0 --color=yes --show_progress_rate_limit=5 + try-import %workspace%/user.bazelrc diff --git a/scripts/windows-ci.bat b/scripts/windows-ci.bat new file mode 100755 index 000000000..e20b1d12a --- /dev/null +++ b/scripts/windows-ci.bat @@ -0,0 +1,35 @@ +set BAZEL=\bazel\bazel.exe --output_user_root=\bazel\anki --output_base=\bazel\anki\base +set BUILDARGS=--config=ci + +echo Building... +:: rollup may fail on the first build, so we build once without checking return code +call %BAZEL% build %BUILDARGS% ... -k + +:: now build/test +echo Running tests... +call %BAZEL% test %BUILDARGS% ... +IF %ERRORLEVEL% NEQ 0 exit /B 1 + +:: build the wheels +call %BAZEL% build %BUILDARGS% pylib/anki:wheel qt/aqt:wheel +IF %ERRORLEVEL% NEQ 0 exit /B 1 + +:: install them into a new venv +echo Creating venv... +\python\python.exe -m venv venv +IF %ERRORLEVEL% NEQ 0 exit /B 1 +call venv\scripts\activate + +:: expand wildcards +for %%i in (bazel-bin/pylib/anki/*.whl) do set "pylib=%%~i" +for %%i in (bazel-bin/qt/aqt/*.whl) do set "qt=%%~i" +echo Installing wheels... +venv\scripts\pip install bazel-bin/pylib/anki/%pylib% bazel-bin/qt/aqt/%qt% pyqtwebengine +IF %ERRORLEVEL% NEQ 0 exit /B 1 + +echo Importing... +python -c "import aqt" +IF %ERRORLEVEL% NEQ 0 exit /B 1 +echo Import succesful. + +echo All tests pass.