From ba2d6734be71811587132277ac406f44b643dfac Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Thu, 11 Oct 2018 18:20:53 -0700 Subject: [PATCH] Add Windows CI to Pipelines using vcpkg for dependencies; merge debug and release for other platforms. --- .gitmodules | 3 + azure-pipelines.yml | 219 +++++++++++++++++++++++++++++++++++--------- vcpkg | 1 + 3 files changed, 182 insertions(+), 41 deletions(-) create mode 100644 .gitmodules create mode 160000 vcpkg diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..3c19d8d07f --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "vcpkg"] + path = vcpkg + url = https://github.com/Microsoft/vcpkg diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f40964713a..bb52036b90 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,30 +1,135 @@ # CppRestSdk Azure Pipelines Configuration jobs: - - job: Ubuntu_1604_Apt_Debug + - job: Windows_VS2017_x86 pool: - vmImage: 'Ubuntu 16.04' + vmImage: 'vs2017-win2016' steps: + - script: .\vcpkg\bootstrap-vcpkg.bat + displayName: Bootstrap vcpkg + - script: .\vcpkg\vcpkg.exe install zlib openssl boost-system boost-date-time boost-regex boost-interprocess websocketpp + displayName: vcpkg install dependencies + - script: mkdir build.common + displayName: Make Build Directory + - task: CMake@1 + inputs: + workingDirectory: 'build.common' + cmakeArgs: '-DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake ..' + - task: MSBuild@1 + inputs: + solution: 'build.common/ALL_BUILD.vcxproj' + maximumCpuCount: true - script: | - sudo apt-get install -y ppa-purge - sudo ppa-purge -y ppa:ondrej/php - sudo apt-get install -y libboost-atomic-dev libboost-thread-dev libboost-system-dev libboost-date-time-dev libboost-regex-dev libboost-filesystem-dev libboost-random-dev libboost-chrono-dev libboost-serialization-dev libwebsocketpp-dev brotli openssl libssl-dev ninja-build - displayName: Apt install dependencies - - script: mkdir build.debug - displayName: Make build.debug + cd build.common\Release\Binaries\Debug + .\test_runner.exe *testd.dll + displayName: 'Run tests, debug' + - task: MSBuild@1 + inputs: + solution: 'build.common/ALL_BUILD.vcxproj' + maximumCpuCount: true + configuration: 'Release' + - script: | + cd build.common\Release\Binaries\Release + .\test_runner.exe *test.dll + displayName: 'Run tests, release' + - job: Windows_VS2017_x64 + pool: + vmImage: 'vs2017-win2016' + steps: + - script: .\vcpkg\bootstrap-vcpkg.bat + displayName: Bootstrap vcpkg + - script: .\vcpkg\vcpkg.exe install zlib openssl boost-system boost-date-time boost-regex boost-interprocess websocketpp --triplet x64-windows + displayName: vcpkg install dependencies + - script: mkdir build.common + displayName: Make Build Directory - task: CMake@1 inputs: - workingDirectory: 'build.debug' - cmakeArgs: '-G Ninja -DCMAKE_BUILD_TYPE=Debug ..' + workingDirectory: 'build.common' + cmakeArgs: '-A x64 -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake ..' + - task: MSBuild@1 + inputs: + solution: 'build.common/ALL_BUILD.vcxproj' + maximumCpuCount: true + platform: 'x64' - script: | - cd build.debug - ninja - displayName: 'Run ninja' + cd build.common\Release\Binaries\Debug + .\test_runner.exe *testd.dll + displayName: 'Run tests, debug' + - task: MSBuild@1 + inputs: + solution: 'build.common/ALL_BUILD.vcxproj' + maximumCpuCount: true + platform: 'x64' + configuration: 'Release' - script: | - cd build.debug/Release/Binaries - ./test_runner *test.so - displayName: 'Run Tests' - - job: Ubuntu_1604_Apt_Release + cd build.common\Release\Binaries\Release + .\test_runner.exe *test.dll + displayName: 'Run tests, release' + - job: Windows_VS2015_x86 + pool: + vmImage: 'vs2015-win2012r2' + steps: + - script: .\vcpkg\bootstrap-vcpkg.bat + displayName: Bootstrap vcpkg + - script: .\vcpkg\vcpkg.exe install zlib openssl boost-system boost-date-time boost-regex boost-interprocess websocketpp + displayName: vcpkg install dependencies + - script: mkdir build.common + displayName: Make Build Directory + - task: CMake@1 + inputs: + workingDirectory: 'build.common' + cmakeArgs: '-DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake ..' + - task: MSBuild@1 + inputs: + solution: 'build.common/ALL_BUILD.vcxproj' + maximumCpuCount: true + - script: | + cd build.common\Release\Binaries\Debug + .\test_runner.exe *testd.dll + displayName: 'Run tests, debug' + - task: MSBuild@1 + inputs: + solution: 'build.common/ALL_BUILD.vcxproj' + maximumCpuCount: true + configuration: 'Release' + - script: | + cd build.common\Release\Binaries\Release + .\test_runner.exe *test.dll + displayName: 'Run tests, release' + - job: Windows_VS2015_x64 + pool: + vmImage: 'vs2015-win2012r2' + steps: + - script: .\vcpkg\bootstrap-vcpkg.bat + displayName: Bootstrap vcpkg + - script: .\vcpkg\vcpkg.exe install zlib openssl boost-system boost-date-time boost-regex boost-interprocess websocketpp --triplet x64-windows + displayName: vcpkg install dependencies + - script: mkdir build.common + displayName: Make Build Directory + - task: CMake@1 + inputs: + workingDirectory: 'build.common' + cmakeArgs: '-A x64 -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake ..' + - task: MSBuild@1 + inputs: + solution: 'build.common/ALL_BUILD.vcxproj' + maximumCpuCount: true + platform: 'x64' + - script: | + cd build.common\Release\Binaries\Debug + .\test_runner.exe *testd.dll + displayName: 'Run tests, debug' + - task: MSBuild@1 + inputs: + solution: 'build.common/ALL_BUILD.vcxproj' + maximumCpuCount: true + platform: 'x64' + configuration: 'Release' + - script: | + cd build.common\Release\Binaries\Release + .\test_runner.exe *test.dll + displayName: 'Run tests, release' + - job: Ubuntu_1604_Apt pool: vmImage: 'Ubuntu 16.04' steps: @@ -33,57 +138,89 @@ jobs: sudo ppa-purge -y ppa:ondrej/php sudo apt-get install -y libboost-atomic-dev libboost-thread-dev libboost-system-dev libboost-date-time-dev libboost-regex-dev libboost-filesystem-dev libboost-random-dev libboost-chrono-dev libboost-serialization-dev libwebsocketpp-dev brotli openssl libssl-dev ninja-build displayName: Apt install dependencies - - script: mkdir build.release - displayName: Make build.release + - script: | + mkdir build.debug + mkdir build.release + displayName: Make Build Directories + - task: CMake@1 + inputs: + workingDirectory: 'build.debug' + cmakeArgs: '-G Ninja -DCMAKE_BUILD_TYPE=Debug ..' - task: CMake@1 inputs: workingDirectory: 'build.release' cmakeArgs: '-G Ninja -DCMAKE_BUILD_TYPE=Release ..' + - script: | + cd build.debug + ninja + displayName: 'Run ninja, debug' + - script: | + cd build.debug/Release/Binaries + ./test_runner *test.so + displayName: 'Run tests, debug' - script: | cd build.release ninja - displayName: 'Run ninja' + displayName: 'Run ninja, release' - script: | cd build.release/Release/Binaries ./test_runner *test.so - displayName: 'Run Tests' - - job: MacOS_Debug + displayName: 'Run tests, release' + + # vcpkg on Linux missing for now due to OpenSSL root certificates + # - job: Ubuntu_1604_Vcpkg_Debug + # pool: + # vmImage: 'Ubuntu 16.04' + # steps: + # - script: | + # ./vcpkg/bootstrap-vcpkg.sh + # ./vcpkg/vcpkg install zlib openssl boost-system boost-date-time boost-regex websocketpp boost-thread boost-filesystem boost-random boost-chrono + # displayName: Apt install dependencies + # - script: mkdir build.debug + # displayName: Make build.debug + # - task: CMake@1 + # inputs: + # workingDirectory: 'build.debug' + # cmakeArgs: '-G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake ..' + # - script: | + # cd build.debug + # ninja + # displayName: 'Run ninja' + # - script: | + # cd build.debug/Release/Binaries + # ./test_runner *test.so + # displayName: 'Run Tests' + - job: MacOS pool: vmImage: 'macOS-10.13' steps: - script: brew install boost openssl ninja - displayName: Berw install dependencies - - script: mkdir build.debug - displayName: Make build.debug + displayName: Brew install dependencies + - script: | + mkdir build.debug + mkdir build.release + displayName: Make Build Directories - task: CMake@1 inputs: workingDirectory: 'build.debug' cmakeArgs: '-G Ninja -DCMAKE_BUILD_TYPE=Debug ..' + - task: CMake@1 + inputs: + workingDirectory: 'build.release' + cmakeArgs: '-G Ninja -DCMAKE_BUILD_TYPE=Release ..' - script: | cd build.debug ninja - displayName: 'Run ninja' + displayName: 'Run ninja, debug' - script: | cd build.debug/Release/Binaries ./test_runner *test.dylib - displayName: 'Run Tests' - - job: MacOS_Release - pool: - vmImage: 'macOS-10.13' - steps: - - script: brew install boost openssl ninja - displayName: Berw install dependencies - - script: mkdir build.release - displayName: Make build.release - - task: CMake@1 - inputs: - workingDirectory: 'build.release' - cmakeArgs: '-G Ninja -DCMAKE_BUILD_TYPE=Release ..' + displayName: 'Run tests, debug' - script: | cd build.release ninja - displayName: 'Run ninja' + displayName: 'Run ninja, release' - script: | cd build.release/Release/Binaries ./test_runner *test.dylib - displayName: 'Run Tests' + displayName: 'Run tests, release' diff --git a/vcpkg b/vcpkg new file mode 160000 index 0000000000..29858b3cb2 --- /dev/null +++ b/vcpkg @@ -0,0 +1 @@ +Subproject commit 29858b3cb2c8a0ec2c85b1b14d6d0a0d1dfe309e