File: appveyor.yml

package info (click to toggle)
fairy-stockfish 11.1-1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 1,076 kB
  • sloc: cpp: 14,112; makefile: 469; python: 415; sh: 284
file content (72 lines) | stat: -rw-r--r-- 2,097 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
version: 1.0.{build}
clone_depth: 50

branches:
  only:
    - master
    - merge
    - appveyor

# Operating system (build VM template)
os: Visual Studio 2017

# Build platform, i.e. x86, x64, AnyCPU. This setting is optional.
platform:
  - x86
  - x64

# build Configuration, i.e. Debug, Release, etc.
configuration:
  - Debug
  - Release

matrix:
  # The build fail immediately once one of the job fails
  fast_finish: true

# Scripts that are called at very beginning, before repo cloning
init:
  - cmake --version
  - msbuild /version

before_build:
  - ps: |
      # Get sources
      $src = get-childitem -Path *.cpp -Recurse -Exclude pyffish.cpp | select -ExpandProperty FullName
      $src = $src -join ' '
      $src = $src.Replace("\", "/")

      # Build CMakeLists.txt
      $t = 'cmake_minimum_required(VERSION 3.8)',
           'project(Stockfish)',
           'set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/src)',
           'set(source_files', $src, ')',
           'add_executable(stockfish ${source_files})'

      # Write CMakeLists.txt withouth BOM
      $MyPath = (Get-Item -Path "." -Verbose).FullName + '\CMakeLists.txt'
      $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
      [System.IO.File]::WriteAllLines($MyPath, $t, $Utf8NoBomEncoding)

      # Obtain bench reference from git log
      $b = git log HEAD | sls "\b[Bb]ench[ :]+[0-9]{7}" | select -first 1
      $bench = $b -match '\D+(\d+)' | % { $matches[1] }
      Write-Host "Reference bench:" $bench
      $g = "Visual Studio 15 2017"
      If (${env:PLATFORM} -eq 'x64') { $g = $g + ' Win64' }
      cmake -G "${g}" .
      Write-Host "Generated files for: " $g

build_script:
  - cmake --build . --config %CONFIGURATION% -- /verbosity:minimal

before_test:
  - cd src/%CONFIGURATION%
  - stockfish bench 2> out.txt >NUL
  - ps: |
      # Verify bench number
      $s = (gc "./out.txt" | out-string)
      $r = ($s -match 'Nodes searched \D+(\d+)' | % { $matches[1] })
      Write-Host "Engine bench:" $r
      Write-Host "Reference bench:" $bench
      If ($r -ne $bench) { exit 1 }