From 9872f23e588a3f1c28a6d22d8a607a530ca377ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 3 Sep 2019 11:13:48 +0200 Subject: [PATCH] package/ci: initial AppVeyor setup. --- package/ci/appveyor-desktop-gles.bat | 97 +++++++++++++++++++++++++++ package/ci/appveyor-desktop.bat | 98 ++++++++++++++++++++++++++++ package/ci/appveyor.yml | 77 ++++++++++++++++++++++ package/ci/codecov.yml | 3 +- 4 files changed, 274 insertions(+), 1 deletion(-) create mode 100644 package/ci/appveyor-desktop-gles.bat create mode 100644 package/ci/appveyor-desktop.bat create mode 100644 package/ci/appveyor.yml diff --git a/package/ci/appveyor-desktop-gles.bat b/package/ci/appveyor-desktop-gles.bat new file mode 100644 index 0000000..8d82664 --- /dev/null +++ b/package/ci/appveyor-desktop-gles.bat @@ -0,0 +1,97 @@ +if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2019" call "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Auxiliary/Build/vcvarsall.bat" x64 || exit /b +if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2017" call "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsall.bat" x64 || exit /b +set PATH=%APPVEYOR_BUILD_FOLDER%\deps\bin;%PATH% + +rem Build pybind11. Downloaded in the appveyor.yml script. +cd pybind11-2.3.0 || exit /b +mkdir -p build && cd build || exit /b +cmake .. ^ + -DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%/deps ^ + -DPYBIND11_PYTHON_VERSION=3.6 ^ + -DPYBIND11_TEST=OFF ^ + -G Ninja || exit /b +ninja install || exit /b +cd .. && cd .. + +rem Build Corrade +git clone --depth 1 git://github.com/mosra/corrade.git || exit /b +cd corrade || exit /b +mkdir build && cd build || exit /b +cmake .. ^ + -DCMAKE_BUILD_TYPE=Release ^ + -DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%/deps ^ + -DBUILD_DEPRECATED=OFF ^ + -DBUILD_STATIC=%BUILD_STATIC% ^ + -DWITH_INTERCONNECT=OFF ^ + -DWITH_PLUGINMANAGER=ON ^ + -DWITH_TESTSUITE=OFF ^ + -DUTILITY_USE_ANSI_COLORS=ON ^ + -G Ninja || exit /b +cmake --build . || exit /b +cmake --build . --target install || exit /b +cd .. && cd .. + +rem Build Magnum +git clone --depth 1 git://github.com/mosra/magnum.git || exit /b +cd magnum || exit /b +mkdir build && cd build || exit /b +cmake .. ^ + -DCMAKE_BUILD_TYPE=Release ^ + -DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%/deps ^ + -DBUILD_DEPRECATED=OFF ^ + -DBUILD_STATIC=%BUILD_STATIC% ^ + -DTARGET_GLES=ON ^ + -DTARGET_GLES2=%TARGET_GLES2% ^ + -DTARGET_DESKTOP_GLES=ON ^ + -DWITH_AUDIO=OFF ^ + -DWITH_DEBUGTOOLS=OFF ^ + -DWITH_GL=ON ^ + -DWITH_MESHTOOLS=ON ^ + -DWITH_PRIMITIVES=ON ^ + -DWITH_SCENEGRAPH=ON ^ + -DWITH_SHADERS=ON ^ + -DWITH_TEXT=OFF ^ + -DWITH_TEXTURETOOLS=ON ^ + -DWITH_TRADE=ON ^ + -DWITH_VK=OFF ^ + -DWITH_SDL2APPLICATION=OFF ^ + -DWITH_GLFWAPPLICATION=OFF ^ + -DWITH_WINDOWLESSWGLAPPLICATION=ON ^ + -G Ninja || exit /b +cmake --build . || exit /b +cmake --build . --target install || exit /b +cd .. && cd .. + +rem Build. BUILD_GL_TESTS is enabled just to be sure, it should not be needed +rem by any plugin. +mkdir build && cd build || exit /b +cmake .. ^ + -DCMAKE_BUILD_TYPE=Release ^ + -DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%/deps ^ + -DPYBIND11_PYTHON_VERSION=3.6 ^ + -DWITH_PYTHON=ON ^ + -G Ninja || exit /b +cmake --build . || exit /b +cmake --build . --target install || exit /b + +rem Verify the setuptools install +cd src/python || exit /b +python setup.py install --root="%APPVEYOR_BUILD_FOLDER%/install" || exit /b + +rem Run tests & gather coverage +cd ../../../src/python/corrade || exit /b +coverage run -m unittest -v && cp .coverage ../.coverage.corrade || exit /b + +cd ../magnum || exit /b +set MAGNUM_SKIP_GL_TESTS=ON +coverage run -m unittest -v && cp .coverage ../.coverage.magnum || exit /b + +rem Test docstring validity +cd ../../../doc/python || exit /b +set PYTHONPATH="%APPVEYOR_BUILD_FOLDER%/build/src/python" +python -m doctest -v *.rst || exit /b + +rem Upload coverage +cd ../../src/python || exit /b +coverage combine || exit /b +codecov -X gcov || exit /b diff --git a/package/ci/appveyor-desktop.bat b/package/ci/appveyor-desktop.bat new file mode 100644 index 0000000..00f4ba8 --- /dev/null +++ b/package/ci/appveyor-desktop.bat @@ -0,0 +1,98 @@ +if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2019" call "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Auxiliary/Build/vcvarsall.bat" x64 || exit /b +if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2017" call "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsall.bat" x64 || exit /b +rem SDL2 has the DLL in lib/x64, and in the static build it's imported so the +rem DLL has to be found. +set PATH=%APPVEYOR_BUILD_FOLDER%\deps\bin;%APPVEYOR_BUILD_FOLDER%\SDL\lib\x64;%PATH% + +rem Build pybind11. Downloaded in the appveyor.yml script. +cd pybind11-2.3.0 || exit /b +mkdir -p build && cd build || exit /b +cmake .. ^ + -DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%/deps ^ + -DPYBIND11_PYTHON_VERSION=3.6 ^ + -DPYBIND11_TEST=OFF ^ + -G Ninja || exit /b +ninja install || exit /b +cd .. && cd .. + +rem Build Corrade +git clone --depth 1 git://github.com/mosra/corrade.git || exit /b +cd corrade || exit /b +mkdir build && cd build || exit /b +cmake .. ^ + -DCMAKE_BUILD_TYPE=Release ^ + -DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%/deps ^ + -DBUILD_DEPRECATED=OFF ^ + -DBUILD_STATIC=%BUILD_STATIC% ^ + -DWITH_INTERCONNECT=OFF ^ + -DWITH_PLUGINMANAGER=ON ^ + -DWITH_TESTSUITE=OFF ^ + -DUTILITY_USE_ANSI_COLORS=ON ^ + -G Ninja || exit /b +cmake --build . || exit /b +cmake --build . --target install || exit /b +cd .. && cd .. + +rem Build Magnum +git clone --depth 1 git://github.com/mosra/magnum.git || exit /b +cd magnum || exit /b +mkdir build && cd build || exit /b +cmake .. ^ + -DCMAKE_BUILD_TYPE=Release ^ + -DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%/deps ^ + -DCMAKE_PREFIX_PATH=%APPVEYOR_BUILD_FOLDER%/SDL ^ + -DBUILD_DEPRECATED=OFF ^ + -DBUILD_STATIC=%BUILD_STATIC% ^ + -DWITH_AUDIO=OFF ^ + -DWITH_DEBUGTOOLS=OFF ^ + -DWITH_GL=ON ^ + -DWITH_MESHTOOLS=ON ^ + -DWITH_PRIMITIVES=ON ^ + -DWITH_SCENEGRAPH=ON ^ + -DWITH_SHADERS=ON ^ + -DWITH_TEXT=OFF ^ + -DWITH_TEXTURETOOLS=ON ^ + -DWITH_TRADE=ON ^ + -DWITH_VK=OFF ^ + -DWITH_SDL2APPLICATION=ON ^ + -DWITH_GLFWAPPLICATION=ON ^ + -DWITH_WINDOWLESSWGLAPPLICATION=ON ^ + -G Ninja || exit /b +cmake --build . || exit /b +cmake --build . --target install || exit /b +cd .. && cd .. + +rem Build. BUILD_GL_TESTS is enabled just to be sure, it should not be needed +rem by any plugin. +mkdir build && cd build || exit /b +cmake .. ^ + -DCMAKE_BUILD_TYPE=Release ^ + -DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%/deps ^ + -DCMAKE_PREFIX_PATH=%APPVEYOR_BUILD_FOLDER%/SDL ^ + -DPYBIND11_PYTHON_VERSION=3.6 ^ + -DWITH_PYTHON=ON ^ + -G Ninja || exit /b +cmake --build . || exit /b +cmake --build . --target install || exit /b + +rem Verify the setuptools install +cd src/python || exit /b +python setup.py install --root="%APPVEYOR_BUILD_FOLDER%/install" || exit /b + +rem Run tests & gather coverage +cd ../../../src/python/corrade || exit /b +coverage run -m unittest -v && cp .coverage ../.coverage.corrade || exit /b + +cd ../magnum || exit /b +set MAGNUM_SKIP_GL_TESTS=ON +coverage run -m unittest -v && cp .coverage ../.coverage.magnum || exit /b + +rem Test docstring validity +cd ../../../doc/python || exit /b +set PYTHONPATH="%APPVEYOR_BUILD_FOLDER%/build/src/python" +python -m doctest -v *.rst || exit /b + +rem Upload coverage +cd ../../src/python || exit /b +coverage combine || exit /b +codecov -X gcov || exit /b diff --git a/package/ci/appveyor.yml b/package/ci/appveyor.yml new file mode 100644 index 0000000..c4ed570 --- /dev/null +++ b/package/ci/appveyor.yml @@ -0,0 +1,77 @@ +clone_depth: 1 + +environment: + matrix: + - TARGET: desktop + COMPILER: msvc + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + APPVEYOR_JOB_NAME: windows-gl-msvc2017 + PYTHON: 36 + - TARGET: desktop + COMPILER: msvc + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + APPVEYOR_JOB_NAME: windows-gl-msvc2019 + PYTHON: 36 + - TARGET: desktop + COMPILER: msvc + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + APPVEYOR_JOB_NAME: windows-static-msvc2019 + BUILD_STATIC: ON + PYTHON: 36 + - TARGET: desktop-gles + TARGET_GLES2: ON + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + APPVEYOR_JOB_NAME: windows-gles2-msvc2017 + PYTHON: 36 + - TARGET: desktop-gles + TARGET_GLES2: ON + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + APPVEYOR_JOB_NAME: windows-gles2-msvc2019 + PYTHON: 36 + - TARGET: desktop-gles + TARGET_GLES2: OFF + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + APPVEYOR_JOB_NAME: windows-gles3-msvc2017 + PYTHON: 36 + - TARGET: desktop-gles + TARGET_GLES2: OFF + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + APPVEYOR_JOB_NAME: windows-gles3-msvc2019 + PYTHON: 36 + +notifications: +- provider: Webhook + url: https://webhooks.gitter.im/e/415ae90928ba0dbd3df4 + on_build_success: false + on_build_failure: true + on_build_status_changed: true + +install: +- cinst ninja +# pip is in Scripts +- set PATH=C:/tools/ninja;C:/Python%PYTHON%-x64;C:/Python%PYTHON%-x64/Scripts;%PATH% +- pip3 install coverage codecov + +- IF NOT "%BUILD_STATIC%" == "ON" set BUILD_STATIC=OFF + +# pybind11. Built in the CI script. +- IF NOT EXIST %APPVEYOR_BUILD_FOLDER%\v2.3.0.zip appveyor DownloadFile https://github.com/pybind/pybind11/archive/v2.3.0.zip +- 7z x v2.3.0.zip + +# SDL2 +- IF "%TARGET%" == "desktop" IF "%COMPILER%" == "msvc" IF NOT EXIST %APPVEYOR_BUILD_FOLDER%\SDL2-devel-2.0.9-VC.zip appveyor DownloadFile http://www.libsdl.org/release/SDL2-devel-2.0.9-VC.zip +- IF "%TARGET%" == "desktop" IF "%COMPILER%" == "msvc" 7z x SDL2-devel-2.0.9-VC.zip && ren SDL2-2.0.9 SDL + +# GLFW +- IF "%TARGET%" == "desktop" IF NOT EXIST %APPVEYOR_BUILD_FOLDER%\glfw-3.2.1.bin.WIN64.zip appveyor DownloadFile https://github.com/glfw/glfw/releases/download/3.2.1/glfw-3.2.1.bin.WIN64.zip +- IF "%TARGET%" == "desktop" 7z x glfw-3.2.1.bin.WIN64.zip && ren glfw-3.2.1.bin.WIN64 glfw && mkdir deps && mkdir deps\lib && mkdir deps\bin && mkdir deps\include && xcopy /e glfw\include\* deps\include\ +- IF "%TARGET%" == "desktop" IF "%COMPILER%" == "msvc" copy glfw\lib-vc2015\glfw3.dll deps\bin\ && copy glfw\lib-vc2015\glfw3dll.lib deps\lib\glfw3.lib + +build_script: +- IF "%TARGET%" == "desktop" IF "%COMPILER%" == "msvc" call package\ci\appveyor-desktop.bat +- IF "%TARGET%" == "desktop-gles" call package\ci\appveyor-desktop-gles.bat + +cache: +- SDL2-devel-2.0.9-VC.zip +- glfw-3.2.1.bin.WIN64.zip +- v2.3.0.zip diff --git a/package/ci/codecov.yml b/package/ci/codecov.yml index dbddb01..ff3e2a6 100644 --- a/package/ci/codecov.yml +++ b/package/ci/codecov.yml @@ -3,6 +3,7 @@ fixes: # with # setup.py next to the C++ binaries and the test is done from here. # Python's coverage.py reports an absolute path to it, which means a simple # "build/src/python/::src/python/" won't suffice. This is hardcoded to Travis -# Linux and macOS build paths so let's hope these won't change. +# Linux / macOS and AppVeyor build paths so let's hope these won't change. - "/home/travis/build/mosra/magnum-bindings/build/src/python/::src/python/" - "/Users/travis/build/mosra/magnum-bindings/build/src/python/::src/python/" +- "C:/projects/magnum-bindings/build/src/python/::src/python/"