2019-02-06 20:55:42 -05:00
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
|
|
|
|
skip_branch_with_pr: true
|
|
|
|
|
2017-04-02 15:24:42 -04:00
|
|
|
|
|
|
|
platform:
|
2019-02-14 17:30:43 -05:00
|
|
|
# - x86
|
2017-04-02 15:24:42 -04:00
|
|
|
- x64
|
|
|
|
|
|
|
|
configuration:
|
2019-02-14 17:30:43 -05:00
|
|
|
# - Debug
|
2017-04-02 15:24:42 -04:00
|
|
|
- Release
|
|
|
|
|
|
|
|
image:
|
2019-02-14 17:30:43 -05:00
|
|
|
# - Visual Studio 2015
|
2017-04-02 15:24:42 -04:00
|
|
|
- Visual Studio 2017
|
|
|
|
|
2018-06-15 13:13:11 -04:00
|
|
|
environment:
|
2019-02-06 20:55:42 -05:00
|
|
|
access_token:
|
|
|
|
secure: JoKQ6wDekwtEk9su/zJWT12TtHMsHAacSLnPe47/SV22BAfVSMMR8VCyDF/W9bE2
|
2019-02-14 13:52:06 -05:00
|
|
|
APPVEYOR_API_TOKEN:
|
|
|
|
secure: JwBE1w4itlwjHKNDVnG+frRTexCT0x6e3iF6Qsw2Ov4=
|
|
|
|
TRAVIS_API_TOKEN:
|
|
|
|
secure: 1U+1NKVIjalxvmkEm9XYMaIrya5yc/rDw9yowBcSbuw=
|
|
|
|
TIMEOUT_MINS: 10
|
2019-01-15 13:27:34 -05:00
|
|
|
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'
|
2018-06-15 13:13:11 -04:00
|
|
|
matrix:
|
2019-02-14 17:30:43 -05:00
|
|
|
# - GSL_CXX_STANDARD: 14
|
|
|
|
# USE_TOOLSET: MSVC
|
|
|
|
# USE_GENERATOR: MSBuild
|
2018-06-15 13:13:11 -04:00
|
|
|
- GSL_CXX_STANDARD: 17
|
2019-01-15 13:27:34 -05:00
|
|
|
USE_TOOLSET: MSVC
|
|
|
|
USE_GENERATOR: MSBuild
|
|
|
|
- GSL_CXX_STANDARD: 14
|
|
|
|
USE_TOOLSET: LLVM
|
|
|
|
USE_GENERATOR: Ninja
|
2019-02-14 17:30:43 -05:00
|
|
|
# - GSL_CXX_STANDARD: 17
|
|
|
|
# USE_TOOLSET: LLVM
|
|
|
|
# USE_GENERATOR: Ninja
|
2018-06-15 13:13:11 -04:00
|
|
|
|
|
|
|
matrix:
|
|
|
|
exclude:
|
|
|
|
- image: Visual Studio 2015
|
|
|
|
GSL_CXX_STANDARD: 17
|
2019-01-15 13:27:34 -05:00
|
|
|
- image: Visual Studio 2015
|
|
|
|
USE_TOOLSET: LLVM
|
|
|
|
USE_GENERATOR: MSBuild
|
2018-06-15 13:13:11 -04:00
|
|
|
|
2017-04-02 15:24:42 -04:00
|
|
|
cache:
|
2017-07-13 16:53:56 -04:00
|
|
|
- C:\cmake-3.8.0-win32-x86
|
2019-01-15 13:27:34 -05:00
|
|
|
- C:\Tools\ninja
|
2017-04-02 15:24:42 -04:00
|
|
|
|
|
|
|
install:
|
|
|
|
- ps: |
|
2019-01-15 13:27:34 -05:00
|
|
|
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"
|
2017-04-02 15:24:42 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
before_build:
|
2019-02-12 21:33:40 -05:00
|
|
|
- set ASM_FOLDER=%APPVEYOR_BUILD_WORKER_IMAGE%_%GSL_CXX_STANDARD%_%USE_TOOLSET%_%PLATFORM%_%CONFIGURATION%
|
2017-04-02 15:24:42 -04:00
|
|
|
- ps: |
|
2019-01-15 13:27:34 -05:00
|
|
|
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"
|
|
|
|
}
|
2019-02-12 21:14:29 -05:00
|
|
|
$env:CMakeGenFlags = "-G Ninja -DGSL_CXX_STANDARD=$env:GSL_CXX_STANDARD -DGSL_ASM_FOLDER=`"$($env:ASM_FOLDER)`""
|
2017-04-02 15:24:42 -04:00
|
|
|
} else {
|
2019-01-15 13:27:34 -05:00
|
|
|
$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") {
|
2019-02-12 21:14:29 -05:00
|
|
|
$env:CMakeGenFlags = "-G `"$Generator`" -A $Architecture -T llvm -DGSL_CXX_STANDARD=$env:GSL_CXX_STANDARD -DGSL_ASM_FOLDER=`"$($env:ASM_FOLDER)`""
|
2019-01-15 13:27:34 -05:00
|
|
|
} else {
|
2019-02-12 21:14:29 -05:00
|
|
|
$env:CMakeGenFlags = "-G `"$Generator`" -A $Architecture -DGSL_CXX_STANDARD=$env:GSL_CXX_STANDARD -DGSL_ASM_FOLDER=`"$($env:ASM_FOLDER)`""
|
2019-01-15 13:27:34 -05:00
|
|
|
}
|
2017-04-02 15:24:42 -04:00
|
|
|
}
|
2019-01-15 13:27:34 -05:00
|
|
|
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";
|
2019-02-11 17:05:25 -05:00
|
|
|
|
|
|
|
#Disable ASM generation for x86, there are errors with the llvm assembler
|
2019-02-11 17:08:12 -05:00
|
|
|
$env:CMakeGenFlags += " -DASM_TESTS_ENABLED=FALSE"
|
2019-01-15 13:27:34 -05:00
|
|
|
} else {
|
|
|
|
$env:CFLAGS = "-m64";
|
|
|
|
$env:CXXFLAGS = "-m64";
|
|
|
|
}
|
2017-04-02 15:24:42 -04:00
|
|
|
}
|
2019-01-15 13:27:34 -05:00
|
|
|
$env:CMakeBuildFlags = "--config $env:CONFIGURATION -- $GeneratorFlags"
|
|
|
|
- mkdir build
|
|
|
|
- cd build
|
|
|
|
- if %USE_GENERATOR%==Ninja (call %VCVARSALL%)
|
|
|
|
- echo %CMakeGenFlags%
|
|
|
|
- cmake .. %CMakeGenFlags%
|
2017-04-02 15:24:42 -04:00
|
|
|
|
|
|
|
build_script:
|
2019-01-15 13:27:34 -05:00
|
|
|
- echo %CMakeBuildFlags%
|
|
|
|
- cmake --build . %CMakeBuildFlags%
|
2017-04-02 15:24:42 -04:00
|
|
|
|
|
|
|
test_script:
|
|
|
|
- ctest -j2
|
|
|
|
|
2019-02-14 13:52:06 -05:00
|
|
|
before_deploy:
|
|
|
|
- ps: |
|
2019-02-14 14:36:22 -05:00
|
|
|
if(-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER)) {
|
2019-02-14 13:52:06 -05:00
|
|
|
# Only push asm during CI. Credentials are not available during a PR
|
2019-02-14 14:36:22 -05:00
|
|
|
Write-Host "[before_deploy] Not a PR, pushing asm!"
|
|
|
|
|
2019-02-14 13:52:06 -05:00
|
|
|
git config --global credential.helper store
|
|
|
|
Add-Content "$HOME\.git-credentials" "https://$($env:access_token):x-oauth-basic@github.com`n" | Out-Null
|
|
|
|
git config --global user.email "dadonenf@microsoft.com"
|
|
|
|
git config --global user.name "Daniel Donenfeld"
|
2019-02-14 14:46:12 -05:00
|
|
|
Push-Location $env:APPVEYOR_BUILD_FOLDER
|
2019-02-14 14:36:22 -05:00
|
|
|
|
|
|
|
Write-Host "[before_deploy] About to call push_asm batch script!"
|
|
|
|
|
2019-02-14 15:05:53 -05:00
|
|
|
cmd.exe /c 'asm\scripts\push_asm.bat'
|
2019-02-14 14:36:22 -05:00
|
|
|
|
|
|
|
Write-Host "[before_deploy] after push asm!"
|
2019-02-14 13:52:06 -05:00
|
|
|
}
|
2019-02-11 19:08:36 -05:00
|
|
|
|
2019-02-14 13:52:06 -05:00
|
|
|
deploy_script:
|
2019-02-14 14:02:04 -05:00
|
|
|
- cd %APPVEYOR_BUILD_FOLDER%
|
2019-02-14 14:14:32 -05:00
|
|
|
- ps: '& "asm\scripts\deploy-asm.ps1"'
|
2019-02-14 19:26:34 -05:00
|
|
|
|
|
|
|
on_finish:
|
|
|
|
- ps: |
|
|
|
|
if(-not (Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER)) {
|
2019-02-15 14:51:34 -05:00
|
|
|
# Delete all branches for asm if this is the last build
|
2019-02-14 19:26:34 -05:00
|
|
|
$build = Invoke-RestMethod -Uri "https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG" -Method GET -Headers @{
|
|
|
|
"Authorization" = "Bearer $env:APPVEYOR_API_TOKEN"
|
|
|
|
"Content-type" = "application/json"
|
|
|
|
}
|
2019-02-15 14:51:34 -05:00
|
|
|
$jobs = $buildData.build.jobs
|
|
|
|
$lastJob = ($jobs | Select-Object -Last 1).jobId
|
|
|
|
|
|
|
|
if ($lastJob -eq $env:APPVEYOR_JOB_ID) {
|
|
|
|
$jobs | Foreach-Object {
|
|
|
|
$branchName = "asm/$($env:APPVEYOR_REPO_COMMIT)/appveyor-$($_.jobId)"
|
|
|
|
git ls-remote --heads --exit-code https://github.com/dadonenf/GSL.git $branchName
|
|
|
|
if($?){
|
2019-02-15 15:02:11 -05:00
|
|
|
git push origin --delete asm/$($env:APPVEYOR_REPO_COMMIT)/appveyor-$($_.jobId) 2>&1
|
2019-02-15 14:51:34 -05:00
|
|
|
}
|
2019-02-15 14:36:40 -05:00
|
|
|
}
|
|
|
|
}
|
2019-02-14 19:26:34 -05:00
|
|
|
}
|