GSL/appveyor.yml
2019-02-06 18:15:51 -08:00

142 lines
4.9 KiB
YAML

branches:
only:
- master
skip_branch_with_pr: true
platform:
- x86
- x64
configuration:
- Debug
- Release
image:
- Visual Studio 2015
- Visual Studio 2017
environment:
access_token:
secure: JoKQ6wDekwtEk9su/zJWT12TtHMsHAacSLnPe47/SV22BAfVSMMR8VCyDF/W9bE2
NINJA_TAG: v1.8.2
NINJA_SHA512: 9B9CE248240665FCD6404B989F3B3C27ED9682838225E6DC9B67B551774F251E4FF8A207504F941E7C811E7A8BE1945E7BCB94472A335EF15E23A0200A32E6D5
NINJA_PATH: C:\Tools\ninja\ninja-%NINJA_TAG%
VCVAR2015: 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat'
VCVAR2017: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat'
matrix:
- GSL_CXX_STANDARD: 14
USE_TOOLSET: MSVC
USE_GENERATOR: MSBuild
- GSL_CXX_STANDARD: 17
USE_TOOLSET: MSVC
USE_GENERATOR: MSBuild
- GSL_CXX_STANDARD: 14
USE_TOOLSET: LLVM
USE_GENERATOR: Ninja
- GSL_CXX_STANDARD: 17
USE_TOOLSET: LLVM
USE_GENERATOR: Ninja
matrix:
exclude:
- image: Visual Studio 2015
GSL_CXX_STANDARD: 17
- image: Visual Studio 2015
USE_TOOLSET: LLVM
USE_GENERATOR: MSBuild
cache:
- C:\cmake-3.8.0-win32-x86
- C:\Tools\ninja
install:
- ps: |
if (![IO.File]::Exists("$env:NINJA_PATH\ninja.exe")) {
Start-FileDownload `
"https://github.com/ninja-build/ninja/releases/download/$env:NINJA_TAG/ninja-win.zip"
$hash = (Get-FileHash ninja-win.zip -Algorithm SHA512).Hash
if ($env:NINJA_SHA512 -eq $hash) {
7z e -y -bso0 ninja-win.zip -o"$env:NINJA_PATH"
} else { Write-Warning "Ninja download hash changed!"; Write-Output "$hash" }
}
if ([IO.File]::Exists("$env:NINJA_PATH\ninja.exe")) {
$env:PATH = "$env:NINJA_PATH;$env:PATH"
} else { Write-Warning "Failed to find ninja.exe in expected location." }
if ($env:USE_TOOLSET -ne "LLVM") {
if (![IO.File]::Exists("C:\cmake-3.8.0-win32-x86\bin\cmake.exe")) {
Start-FileDownload 'https://cmake.org/files/v3.8/cmake-3.8.0-win32-x86.zip'
7z x -y -bso0 cmake-3.8.0-win32-x86.zip -oC:\
}
$env:PATH="C:\cmake-3.8.0-win32-x86\bin;$env:PATH"
}
before_build:
- ps: |
if ("$env:USE_GENERATOR" -eq "Ninja") {
$GeneratorFlags = '-k 10'
$Architecture = $env:PLATFORM
if ("$env:APPVEYOR_BUILD_WORKER_IMAGE" -eq "Visual Studio 2015") {
$env:VCVARSALL = "`"$env:VCVAR2015`" $Architecture"
} else {
$env:VCVARSALL = "`"$env:VCVAR2017`" $Architecture"
}
$env:CMakeGenFlags = "-G Ninja -DGSL_CXX_STANDARD=$env:GSL_CXX_STANDARD -DGSL_ASM_FOLDER=`"$($env:APPVEYOR_BUILD_WORKER_IMAGE)_$($env:GSL_CXX_STANDARD)_$($env:USE_TOOLSET)_$($env:PLATFORM)_$($env:CONFIGURATION)`""
} else {
$GeneratorFlags = '/m /v:minimal'
if ("$env:APPVEYOR_BUILD_WORKER_IMAGE" -eq "Visual Studio 2015") {
$Generator = 'Visual Studio 14 2015'
} else {
$Generator = 'Visual Studio 15 2017'
}
if ("$env:PLATFORM" -eq "x86") {
$Architecture = "Win32"
} else {
$Architecture = "x64"
}
if ("$env:USE_TOOLSET" -eq "LLVM") {
$env:CMakeGenFlags = "-G `"$Generator`" -A $Architecture -T llvm -DGSL_CXX_STANDARD=$env:GSL_CXX_STANDARD -DGSL_ASM_FOLDER=`"$($env:APPVEYOR_BUILD_WORKER_IMAGE)_$($env:GSL_CXX_STANDARD)_$($env:USE_TOOLSET)_$($env:PLATFORM)_$($env:CONFIGURATION)`""
} else {
$env:CMakeGenFlags = "-G `"$Generator`" -A $Architecture -DGSL_CXX_STANDARD=$env:GSL_CXX_STANDARD -DGSL_ASM_FOLDER=`"$($env:APPVEYOR_BUILD_WORKER_IMAGE)_$($env:GSL_CXX_STANDARD)_$($env:USE_TOOLSET)_$($env:PLATFORM)_$($env:CONFIGURATION)`""
}
}
if ("$env:USE_TOOLSET" -eq "LLVM") {
$env:CC = "clang-cl"
$env:CXX = "clang-cl"
if ("$env:PLATFORM" -eq "x86") {
$env:CFLAGS = "-m32";
$env:CXXFLAGS = "-m32";
} else {
$env:CFLAGS = "-m64";
$env:CXXFLAGS = "-m64";
}
}
$env:CMakeBuildFlags = "--config $env:CONFIGURATION -- $GeneratorFlags"
- mkdir build
- cd build
- if %USE_GENERATOR%==Ninja (call %VCVARSALL%)
- echo %CMakeGenFlags%
- cmake .. %CMakeGenFlags%
build_script:
- echo %CMakeBuildFlags%
- cmake --build . %CMakeBuildFlags%
test_script:
- ctest -j2
on_success:
- git config --global credential.helper store
- ps: Add-Content "$HOME\.git-credentials" "https://$($env:access_token):x-oauth-basic@github.com`n"
- git config --global user.email "dadonenf@microsoft.com"
- git config --global user.name "Daniel Donenfeld"
- cd %APPVEYOR_BUILD_FOLDER%
- git checkout %APPVEYOR_REPO_BRANCH%
- git add "asm\%APPVEYOR_BUILD_WORKER_IMAGE%_%GSL_CXX_STANDARD%_%PLATFORM%_%CONFIGURATION%"
- git commit -m "[skip ci] Update ASM for %APPVEYOR_BUILD_WORKER_IMAGE%_%GSL_CXX_STANDARD%_%PLATFORM%_%CONFIGURATION%"
- git push
deploy: off