mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Enable pytest for appveyor (#5555)
- use vcpkg to install and build grpc - use cache for grpc binaries - execute tests using pytest
This commit is contained in:
parent
7f2331a4db
commit
3b879d4225
@ -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
|
||||
- ps: .\appveyor-build.ps1
|
||||
|
40
appveyor-build.ps1
Normal file
40
appveyor-build.ps1
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user