Merge pull request #9 from microsoft/brhick/pipeline
Set up CI with Azure Pipelines
This commit is contained in:
Коммит
0cf996a8dd
|
@ -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'
|
Загрузка…
Ссылка в новой задаче