335 строки
11 KiB
YAML
335 строки
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
|
|
- CONTRIBUTING.md
|
|
- SECURITY.md
|
|
# These files are only used by the Linux CI builds and don't affect
|
|
# the Windows builds.
|
|
- .github/**/*
|
|
- .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
|
|
- BOND_BUILD: C++
|
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
|
BOND_ARCH: 64
|
|
BOND_BOOST: "1.61.0"
|
|
- BOND_BUILD: C#
|
|
BOND_OUTPUT: Properties
|
|
BOND_CONFIG: Debug
|
|
- BOND_BUILD: Doc
|
|
- BOND_BUILD: C#
|
|
BOND_OUTPUT: Fields
|
|
BOND_CONFIG: Fields
|
|
- BOND_BUILD: Python
|
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
|
BOND_ARCH: 32
|
|
BOND_BOOST: "1.62.0"
|
|
- BOND_BUILD: Python
|
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
|
BOND_ARCH: 64
|
|
BOND_BOOST: "1.63.0"
|
|
install:
|
|
# Installing .NET Core needs Windows Update enabled.
|
|
- sc config wuauserv start= auto
|
|
- net start wuauserv
|
|
- ps: >-
|
|
if (-not $env:BOND_VS_VERSION)
|
|
{
|
|
$env:BOND_VS_VERSION = $env:APPVEYOR_BUILD_WORKER_IMAGE
|
|
if (-not $env:BOND_VS_VERSION)
|
|
{
|
|
$env:BOND_VS_VERSION = 'Visual Studio 2015'
|
|
}
|
|
}
|
|
|
|
if (($env:BOND_BUILD -eq 'C++') -or ($env:BOND_BUILD -eq 'Python')) {
|
|
|
|
git submodule update --init thirdparty\rapidjson
|
|
|
|
$boostComponents = (
|
|
'boost_chrono',
|
|
'boost_date_time',
|
|
'boost_thread',
|
|
'boost_system',
|
|
'boost_unit_test_framework')
|
|
|
|
if ($env:BOND_BUILD -eq 'Python') {
|
|
$boostComponents += 'boost_python'
|
|
}
|
|
|
|
$vcToolsetVer = tools\ci-scripts\windows\ConvertTo-MsvcVersion.ps1 `
|
|
-ImageName $env:BOND_VS_VERSION `
|
|
-Format VcToolSetVer
|
|
|
|
$boostLoc = tools\ci-scripts\windows\Get-BoostLocation.ps1 `
|
|
-Version $env:BOND_BOOST `
|
|
-VcToolSetVer $vcToolSetVer
|
|
|
|
if (-not $boostLoc)
|
|
{
|
|
$boostLoc = tools\ci-scripts\windows\Install-Boost.ps1 `
|
|
-Version $env:BOND_BOOST `
|
|
-VcToolSetVer $vcToolSetVer `
|
|
-Components $boostComponents
|
|
}
|
|
|
|
if ((-not $boostLoc) -or (-not $boostLoc['BOOST_LIBRARYDIR'][$env:BOND_ARCH]))
|
|
{
|
|
throw "No Boost libraries found/installed for $env:BOND_BOOST $env:BOND_ARCH"
|
|
}
|
|
|
|
$env:BOOST_ROOT = $boostLoc['BOOST_ROOT']
|
|
$env:BOOST_LIBRARYDIR = $boostLoc['BOOST_LIBRARYDIR'][$env:BOND_ARCH]
|
|
}
|
|
|
|
choco install haskell-stack -y
|
|
|
|
choco install dotnetcore-sdk -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"
|
|
|
|
$env:Path += "C:\Program Files\doxygen\bin"
|
|
|
|
Get-Command doxygen,pandoc
|
|
|
|
}
|
|
|
|
cache:
|
|
- cs\packages -> cs\test\core\packages.config
|
|
- "c:\\sr"
|
|
|
|
before_build:
|
|
- ps: >-
|
|
$env:PreferredToolArchitecture = "x64"
|
|
|
|
$env:_IsNativeEnvironment = "true"
|
|
|
|
$vsCmakeGeneratorNum = tools\ci-scripts\windows\ConvertTo-MsvcVersion.ps1 `
|
|
-ImageName $env:BOND_VS_VERSION `
|
|
-Format CMakeGeneratorNum
|
|
|
|
$vsYear = tools\ci-scripts\windows\ConvertTo-MsvcVersion.ps1 `
|
|
-ImageName $env:BOND_VS_VERSION `
|
|
-Format Year
|
|
|
|
$cmakeGenerator = "Visual Studio $vsCmakeGeneratorNum $vsYear"
|
|
|
|
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++") {
|
|
|
|
dotnet 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
|
|
|
|
$env:Path = "C:\Python27\;${env:Path}"
|
|
|
|
if ($env:BOND_ARCH -eq 64) {
|
|
$env:Path = "C:\Python27-x64\scripts;C:\Python27-x64\;${env:Path}"
|
|
}
|
|
|
|
}
|
|
|
|
if ($env:BOND_ARCH -eq 64) {
|
|
|
|
$pythonExt = "-x64"
|
|
|
|
}
|
|
|
|
if ($env:BOND_BUILD -eq "Python") {
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
cmake "-DBoost_ADDITIONAL_VERSIONS=${env:BOND_BOOST}" "-DPYTHON_EXECUTABLE:FILEPATH=C:\Python27${pythonExt}\python.exe" $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\Compat' )
|
|
|
|
dotnet msbuild cs\cs.sln /verbosity:minimal "/target:$($compatTests -join ';')"
|
|
|
|
if (-not $?) { throw "cs compat build failed" }
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
cmake "-DPYTHON_EXECUTABLE:FILEPATH=C:\Python27${pythonExt}\python.exe" $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 (($LASTEXITCODE -eq 0) -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
|
|
|
|
if ($LASTEXITCODE -ne 0) { throw "Cloning gh-pages branch failed: $LASTEXITCODE" }
|
|
|
|
cd gh-pages
|
|
|
|
robocopy ..\html . /E /J /MIR /MT /NFL /XD .git 2>&1
|
|
|
|
# Robocopy uses exit codes 0-7 to convey details about
|
|
# what was copied. Exit code 8 starts the range of
|
|
# errors.
|
|
|
|
if ($LASTEXITCODE -ge 8) { throw "Robocopy documentation failed: $LASTEXITCODE" }
|
|
|
|
git add --all .
|
|
|
|
if ($LASTEXITCODE -ne 0) { throw "git add failed: $LASTEXITCODE" }
|
|
|
|
# Don't test exit code of 'git commit'. When there is
|
|
# nothing to commit, it exits with 1. The push below
|
|
# should still exit with 0 after not doing anything, so
|
|
# the build will still pass.
|
|
|
|
git commit -m "Update documentation"
|
|
|
|
git push origin gh-pages 2>&1 | out-null
|
|
|
|
if ($LASTEXITCODE -ne 0) { throw "git push failed: $LASTEXITCODE" }
|
|
|
|
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#") {
|
|
|
|
dotnet msbuild cs\cs.sln /verbosity:minimal /p:Configuration=${env:BOND_CONFIG}
|
|
|
|
}
|
|
|
|
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#") {
|
|
dotnet test cs\test\core\Core.csproj
|
|
if (-not $?) { throw "tests failed" }
|
|
|
|
dotnet test cs\test\coreNS10\CoreNS10.csproj
|
|
if (-not $?) { throw "tests failed" }
|
|
|
|
dotnet test cs\test\internal\Internal.csproj
|
|
if (-not $?) { throw "tests failed" }
|
|
|
|
& cs\test\test-examples.ps1 -IgnorePatterns '*\shared-types-assembly\*' -ErrorVariable exampleErrors
|
|
if ($exampleErrors) { throw "One or more example failed. See above for details." }
|
|
}
|
|
|
|
if (-not $?) { throw "build failed" }
|