Remove bonus for killers.
[stockfish] / appveyor.yml
1 version: 1.0.{build}
2 clone_depth: 50
3
4 branches:
5   only:
6     - master
7
8 # Operating system (build VM template)
9 os: Visual Studio 2019
10
11 # Build platform, i.e. x86, x64, AnyCPU. This setting is optional.
12 platform:
13   - x86
14   - x64
15
16 # build Configuration, i.e. Debug, Release, etc.
17 configuration:
18   - Debug
19   - Release
20
21 matrix:
22   # The build fail immediately once one of the job fails
23   fast_finish: true
24
25 # Scripts that are called at very beginning, before repo cloning
26 init:
27   - cmake --version
28   - msbuild /version
29
30 before_build:
31   - ps: |
32       # Get sources
33       $src = get-childitem -Path *.cpp -Recurse | select -ExpandProperty FullName
34       $src = $src -join ' '
35       $src = $src.Replace("\", "/")
36
37       # Build CMakeLists.txt
38       $t = 'cmake_minimum_required(VERSION 3.17)',
39            'project(Stockfish)',
40            'set(CMAKE_CXX_STANDARD 17)',
41            'set(CMAKE_CXX_STANDARD_REQUIRED ON)',
42            'set (CMAKE_CXX_EXTENSIONS OFF)',
43            'set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/src)',
44            'set(source_files', $src, ')',
45            'add_executable(stockfish ${source_files})'
46
47       # Write CMakeLists.txt withouth BOM
48       $MyPath = (Get-Item -Path "." -Verbose).FullName + '\CMakeLists.txt'
49       $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
50       [System.IO.File]::WriteAllLines($MyPath, $t, $Utf8NoBomEncoding)
51
52       # Obtain bench reference from git log
53       $b = git log HEAD | sls "\b[Bb]ench[ :]+[0-9]{7}" | select -first 1
54       $bench = $b -match '\D+(\d+)' | % { $matches[1] }
55       Write-Host "Reference bench:" $bench
56       $g = "Visual Studio 16 2019"
57       If (${env:PLATFORM} -eq 'x64') { $a = "x64" }
58       If (${env:PLATFORM} -eq 'x86') { $a = "Win32" }
59       cmake -G "${g}" -A ${a} .
60       Write-Host "Generated files for: " $g $a
61
62 build_script:
63   - cmake --build . --config %CONFIGURATION% -- /verbosity:minimal
64   - ps: |
65       # Download default NNUE net from fishtest
66       $nnuenet = Get-Content -Path src\evaluate.h | Select-String -CaseSensitive -Pattern "EvalFileDefaultName" | Select-String -CaseSensitive -Pattern "nn-[a-z0-9]{12}.nnue"
67       $dummy = $nnuenet -match "(?<nnuenet>nn-[a-z0-9]{12}.nnue)"
68       $nnuenet = $Matches.nnuenet
69       Write-Host "Default net:" $nnuenet
70       $nnuedownloadurl = "https://tests.stockfishchess.org/api/nn/$nnuenet"
71       $nnuefilepath = "src\${env:CONFIGURATION}\$nnuenet"
72       if (Test-Path -Path $nnuefilepath) {
73             Write-Host "Already available."
74       } else {
75             Write-Host "Downloading $nnuedownloadurl to $nnuefilepath"
76             Invoke-WebRequest -Uri $nnuedownloadurl -OutFile $nnuefilepath
77       }
78
79 before_test:
80   - cd src/%CONFIGURATION%
81   - stockfish bench 2> out.txt >NUL
82   - ps: |
83       # Verify bench number
84       $s = (gc "./out.txt" | out-string)
85       $r = ($s -match 'Nodes searched \D+(\d+)' | % { $matches[1] })
86       Write-Host "Engine bench:" $r
87       Write-Host "Reference bench:" $bench
88       If ($r -ne $bench) { exit 1 }