Set up CI with Azure Pipelines

[skip ci]
This commit is contained in:
Bryan Hicks 2020-01-09 12:19:45 -08:00 коммит произвёл Bryan Hicks
Родитель 297fbc4f9a
Коммит 91b76b78ec
1 изменённых файлов: 47 добавлений и 0 удалений

47
pipeline.yml Normal file
Просмотреть файл

@ -0,0 +1,47 @@
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- master
pr:
- master
jobs:
- job: Windows
displayName: 'Build on Windows'
pool:
vmImage: windows-2019
workspace:
clean: all
variables:
UnitTests.ResultsFilename: 'UnitTestResults.xml'
steps:
- task: CmdLine@2
displayName: 'Build with CMake and Ninja'
inputs:
script: |
echo on
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
"%DevEnvDir%CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -G "Ninja" -DCMAKE_BINARY_DIR="%BUILD_BINARIESDIRECTORY%" -Dgtest_force_shared_crt:BOOL="True" -DCMAKE_CXX_COMPILER:FILEPATH="%VCToolsInstallDir%bin/HostX64/x64/cl.exe" -DCMAKE_C_COMPILER:FILEPATH="%VCToolsInstallDir%bin/HostX64/x64/cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_MAKE_PROGRAM="%DevEnvDir%CommonExtensions\Microsoft\CMake\Ninja\ninja.exe" "%BUILD_SOURCESDIRECTORY%"
Ninja
workingDirectory: $(Build.BinariesDirectory)
failOnStderr: true
- task: CmdLine@2
displayName: 'Run Unit Tests'
inputs:
script: |
echo on
"%BUILD_BINARIESDIRECTORY%\test\AccessorFrameworkTests.exe" --gtest_output=xml:%UNITTESTS_RESULTSFILENAME%
workingDirectory: $(Build.BinariesDirectory)
failOnStderr: true
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/$(UnitTests.ResultsFilename)'
searchFolder: $(Build.BinariesDirectory)
mergeTestResults: true
testRunTitle: '$(Build.BuildNumber).UnitTests'