diff --git a/.appveyor.yml b/.appveyor.yml index d6b0a0cde7..c949f9e689 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,19 +1,7 @@ version: 1.0.{build} -branches: - only: - - dev image: Visual Studio 2017 -clone_depth: 1 environment: QT5: C:\Qt\5.13.2\msvc2017_64 +cache: C:\vcpkg build_script: -- cmd: >- - mkdir cmakebuild - - cd cmakebuild - - if exist "%QT5%" set Path=%QT5%\bin;%Path% - - cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Release -DRESINSIGHT_ENABLE_UNITY_BUILD=on -DRESINSIGHT_ENABLE_PRECOMPILED_HEADERS=on "-DCMAKE_PREFIX_PATH=%QT5%" .. - - cmake --build . --target ResInsight --config Release \ No newline at end of file +- ps: .\appveyor-build.ps1 diff --git a/appveyor-build.ps1 b/appveyor-build.ps1 new file mode 100644 index 0000000000..0ca208965c --- /dev/null +++ b/appveyor-build.ps1 @@ -0,0 +1,40 @@ +if ( ! (Test-Path -Path "C:/vcpkg") ) { + cd C:\ + git clone -q https://github.com/Microsoft/vcpkg.git + cd .\vcpkg + + # Checkout grpc v 1.19.1 + # https://github.com/microsoft/vcpkg/commit/8b4a607c328d100ac9892e2cbcfb9a4b0cf44c10 + git checkout -q 8b4a607c328d100ac9892e2cbcfb9a4b0cf44c10 + .\bootstrap-vcpkg.bat + + # Set instructions to vcpkb to build release only + Add-Content .\triplets\x64-windows.cmake "set(VCPKG_BUILD_TYPE release)" + + # Install grpc + .\vcpkg.exe install grpc --triplet x64-windows +} + +### Python +$env:PATH = "C:\Python37;C:\Python37\Scripts;$env:PATH" + +python --version +python -m pip install --upgrade pip +python -m pip install grpcio-tools +python -m pip install pytest + +$env:PATH = "$env:QT5\bin;$env:PATH" + +#### BUILD +mkdir cmakebuild +cd .\cmakebuild + +cmake -DCMAKE_BUILD_TYPE=Release -DRESINSIGHT_ENABLE_UNITY_BUILD=on -DRESINSIGHT_ENABLE_PRECOMPILED_HEADERS=on "-DCMAKE_PREFIX_PATH=$env:QT5" -DRESINSIGHT_ENABLE_GRPC=true -DRESINSIGHT_GRPC_PYTHON_EXECUTABLE=C:/Python37/python.exe -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake -A x64 .. + +cmake --build . --target ResInsight --config Release + +### TEST +$env:RESINSIGHT_EXECUTABLE="$env:APPVEYOR_BUILD_FOLDER/cmakebuild/ApplicationCode/Release/ResInsight.exe" + +cd ../ApplicationCode/GrpcInterface/Python/rips +python -m pytest --console