bond/appveyor.yml

338 строки
11 KiB
YAML

# fsharp feature branch
-
version: 1.0.{build}
clone_depth: 15
branches:
only:
- fsharp
configuration: Debug
build:
project: fsharp\fsharp.sln
verbosity: minimal
test:
assemblies: fsharp\test\TypeProvider\bin\$(configuration)\BondFsharpUnitTest.dll
# other branches
-
version: 1.0.{build}
clone_depth: 15
skip_commits:
files:
# These files are high-churn, but don't affect the build.
#
# NB: README.md is NOT in this list; the documentation build
# consumes it.
- CHANGELOG.md
# These files are only used by the Travis CI builds and don't affect
# the Windows builds.
- .travis.yml
- tools/ci-scripts/linux/**
environment:
global:
STACK_ROOT: "c:\\sr"
BOND_TOKEN:
secure: MdnZ86SpR3+/fVz2u31blV83LH6juiobrvO/l1Ak4zG7ykxtvfUI/Vd4l7etYB4J
# The slowest configurations should come first to help reduce
# overall completion time since we run multiple configurations in
# parallel.
matrix:
# C++ Core build and tests (Visual C++ 2013)
- BOND_BUILD: C++
BOND_VS: "Visual Studio 12 2013"
BOND_VS_NUM: 12
BOND_ARCH: 32
BOND_BOOST: 58
BOND_CMAKE_FLAGS: "-DBOND_ENABLE_GRPC=FALSE;-DBOND_SKIP_GBC_TESTS=TRUE"
# C++ Core build and tests
- BOND_BUILD: C++
BOND_VS: "Visual Studio 14 2015"
BOND_VS_NUM: 14
BOND_ARCH: 64
BOND_BOOST: 60
BOND_CMAKE_FLAGS: "-DBOND_ENABLE_GRPC=FALSE"
- BOND_BUILD: C#
BOND_OUTPUT: Properties
BOND_CONFIG: Debug
- BOND_BUILD: "C# .NET Core"
BOND_CONFIG: Debug
- BOND_BUILD: Doc
- BOND_BUILD: C#
BOND_OUTPUT: Fields
BOND_CONFIG: Fields
- BOND_BUILD: Python
BOND_VS: "Visual Studio 14 2015"
BOND_VS_NUM: 14
BOND_ARCH: 32
BOND_BOOST: 60
BOND_CMAKE_FLAGS: "-DBOND_ENABLE_GRPC=FALSE"
- BOND_BUILD: Python
BOND_VS: "Visual Studio 14 2015"
BOND_VS_NUM: 14
BOND_ARCH: 64
BOND_BOOST: 63
BOND_CMAKE_FLAGS: "-DBOND_ENABLE_GRPC=FALSE"
# C++ Comm build and tests
- BOND_BUILD: C++
BOND_VS: "Visual Studio 14 2015"
BOND_VS_NUM: 14
BOND_ARCH: 64
BOND_BOOST: 63
BOND_CMAKE_FLAGS: "-DBOND_ENABLE_COMM=TRUE;-DBOND_ENABLE_GRPC=FALSE;-DBOND_SKIP_CORE_TESTS=TRUE;-DBOND_SKIP_GBC_TESTS=TRUE"
# C++ gRPC build and tests
- BOND_BUILD: C++
BOND_VS: "Visual Studio 14 2015"
BOND_VS_NUM: 14
BOND_ARCH: 64
BOND_BOOST: 63
BOND_CMAKE_FLAGS: "-DBOND_SKIP_CORE_TESTS=TRUE;-DBOND_SKIP_GBC_TESTS=TRUE"
# C++ Comm build and tests (Visual C++ 2013)
- BOND_BUILD: C++
BOND_VS: "Visual Studio 12 2013"
BOND_VS_NUM: 12
BOND_ARCH: 64
BOND_BOOST: 58
BOND_CMAKE_FLAGS: "-DBOND_ENABLE_COMM=TRUE;-DBOND_ENABLE_GRPC=FALSE;-DBOND_SKIP_CORE_TESTS=TRUE;-DBOND_SKIP_GBC_TESTS=TRUE"
install:
- ps: >-
if (($env:BOND_BUILD -eq 'C++') -or ($env:BOND_BUILD -eq 'Python')) {
git submodule update --init thirdparty\rapidjson
# If gRPC is not disabled, init gRPC and its dependencies
if (($env:BOND_BUILD -eq 'C++') -and (-not ($env:BOND_CMAKE_FLAGS -match '-DBOND_ENABLE_GRPC=FALSE'))) {
git submodule update --init --recursive thirdparty\grpc
}
}
if ($env:BOND_BOOST -eq 56) {
# Hard-coded Boost path per https://www.appveyor.com/docs/installed-software#languages-libraries-frameworks
$env:BOOST_ROOT = "C:/Libraries/boost"
$env:BOOST_LIBRARYDIR = "C:/Libraries/boost/lib${env:BOND_ARCH}-msvc-${env:BOND_VS_NUM}.0"
}
else {
$env:BOOST_ROOT = "C:/Libraries/boost_1_${env:BOND_BOOST}_0"
$env:BOOST_LIBRARYDIR = "C:/Libraries/boost_1_${env:BOND_BOOST}_0/lib${env:BOND_ARCH}-msvc-${env:BOND_VS_NUM}.0"
}
choco install haskell-stack -y
# choco install updated the path, so re-read them from the registry and reset $env:path
$machinePath = [System.Environment]::GetEnvironmentVariable("Path","Machine")
$userPath = [System.Environment]::GetEnvironmentVariable("Path","User")
$env:Path = "$machinePath;$userPath"
if ($env:BOND_BUILD -eq "Doc") {
choco install pandoc --version 1.19.2 -y
choco install doxygen.install -y
$machinePath = [System.Environment]::GetEnvironmentVariable("Path","Machine")
$userPath = [System.Environment]::GetEnvironmentVariable("Path","User")
$env:Path = "$machinePath;$userPath"
}
if (($env:BOND_BUILD -eq 'C++') -and (-not ($env:BOND_CMAKE_FLAGS -match '-DBOND_ENABLE_GRPC=FALSE'))) {
# We're building C++ and gRPC isn't disabled, so we need
# gRPC dependencies.
choco install yasm -y
$machinePath = [System.Environment]::GetEnvironmentVariable("Path","Machine")
$userPath = [System.Environment]::GetEnvironmentVariable("Path","User")
$env:Path = "$machinePath;$userPath"
}
cache:
- cs\packages -> cs\test\core\packages.config
- "c:\\sr"
before_build:
- ps: >-
$env:PreferredToolArchitecture = "x64"
$env:_IsNativeEnvironment = "true"
$cmakeGenerator = $env:BOND_VS
if ($env:BOND_ARCH -eq 64) {
$cmakeGenerator += " Win64"
}
$cmakeFlags = $env:BOND_CMAKE_FLAGS -split ';'
if ($env:BOND_BUILD -eq "C#" -Or $env:BOND_BUILD -eq "C++") {
nuget restore cs\cs.sln
}
if ($env:BOND_BUILD -eq "Python" -Or $env:BOND_BUILD -eq "C++") {
# Make sure we have Python27-64 before any other version
if ($env:BOND_ARCH -eq 64) {
$env:Path = "C:\Python27-x64\scripts;C:\Python27-x64\;${env:Path}"
}
}
if ($env:BOND_BUILD -eq "Python") {
mkdir build
cd build
cmake "-DBoost_ADDITIONAL_VERSIONS=1.${env:BOND_BOOST}.0" $cmakeFlags -G $cmakeGenerator ..
}
if ($env:BOND_BUILD -eq "C++") {
# We don't always need all of these compat tests--depending
# on what part of C++ we're building--but they're pretty
# fast to build, so build them all.
$compatTests = ('Tests\CommCompatClient', 'Tests\CommCompatServer', 'Tests\Compat', 'Tests\GrpcCompatClient', 'Tests\GrpcCompatServer')
msbuild cs\cs.sln /verbosity:minimal "/target:$($compatTests -join ';')" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
if (-not $?) { throw "cs compat build failed" }
mkdir build
cd build
cmake $cmakeFlags -G $cmakeGenerator .. 2>cmake_stderr.log
Get-Content cmake_stderr.log
}
if ($env:BOND_BUILD -eq "Doc") {
mkdir build
cd build
cmake ../doc
}
build_script:
- ps: >-
$env:PreferredToolArchitecture = "x64"
$env:_IsNativeEnvironment = "true"
if ($env:BOND_BUILD -eq "Doc") {
cmake --build . --target documentation -- /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
if ($? -And $env:BOND_TOKEN -And $env:APPVEYOR_REPO_BRANCH -eq "master") {
git config --global user.email "bondlab@microsoft.com"
git config --global user.name "Appveyor"
git clone -b gh-pages "https://${env:BOND_TOKEN}@github.com/Microsoft/bond.git" gh-pages 2>&1 | out-null
cd gh-pages
if (-not $?) { throw "Cloning gh-pages failed" }
Remove-Item * -Recurse
Copy-Item ..\html\* . -Recurse
git add --all .
git commit -m "Update documentation"
git push origin gh-pages 2>&1 | out-null
cd ..
}
}
if ($env:BOND_BUILD -eq "Python") {
cmake --build . --target python_unit_test -- /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
}
if ($env:BOND_BUILD -eq "C++") {
cmake --build . --target check -- /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
}
if ($env:BOND_BUILD -eq "C#") {
msbuild cs\cs.sln /verbosity:minimal /p:Configuration=${env:BOND_CONFIG} /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
}
if ($env:BOND_BUILD -eq "C# .NET Core") {
& cs\dnc\build.ps1 -Configuration $env:BOND_CONFIG -Verbosity minimal -MSBuildLogger "C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
}
if (-not $?) { throw "build failed" }
test_script:
- ps: >-
if ($env:BOND_BUILD -eq "Python") {
ctest -C Debug --tests-regex python_unit_test --output-on-failure
if (-not $?) { throw "tests failed" }
}
if ($env:BOND_BUILD -eq "C#") {
nunit-console-x86 /framework:net-4.5 /labels "cs\test\core\bin\debug\net45\${env:BOND_OUTPUT}\Bond.UnitTest.dll" cs\test\internal\bin\debug\net45\Bond.InternalTest.dll
if (-not $?) { throw "tests failed" }
nunit-console-x86 /framework:net-4.5 /labels "cs\test\core\bin\debug\net45-nonportable\${env:BOND_OUTPUT}\Bond.UnitTest.dll"
if (-not $?) { throw "tests failed" }
& examples\cs\grpc\pingpong\bin\Debug\grpc-pingpong.exe
if (-not $?) { throw "tests failed" }
& examples\cs\grpc\scalar\bin\Debug\grpc-scalar.exe
if (-not $?) { throw "tests failed" }
# We need to investigate why these tests are failing in AppVeyor, but not locally.
# nunit-console-x86 /framework:net-4.5 /labels "cs\test\comm\bin\debug\net45\${env:BOND_OUTPUT}\Bond.Comm.UnitTest.dll"
# if (-not $?) { throw "tests failed" }
}
if ($env:BOND_BUILD -eq "C# .NET Core") {
& cs\dnc\build.ps1 -Test -Configuration $env:BOND_CONFIG -Verbosity minimal -MSBuildLogger "C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
if (-not $?) { throw "tests failed" }
}
if (-not $?) { throw "build failed" }