Merge remote-tracking branch 'upstream/master' into HEAD
[stockfish] / .travis.yml
1 language: cpp
2 dist: bionic
3
4 matrix:
5   include:
6     - os: linux
7       compiler: gcc
8       addons:
9         apt:
10           packages: ['g++-8', 'g++-8-multilib', 'g++-multilib', 'valgrind', 'expect', 'curl']
11       env:
12         - COMPILER=g++-8
13         - COMP=gcc
14
15     - os: linux
16       compiler: clang
17       addons:
18         apt:
19           packages: ['clang-10', 'llvm-10-dev', 'g++-multilib', 'valgrind', 'expect', 'curl']
20       env:
21         - COMPILER=clang++-10
22         - COMP=clang
23
24     - os: osx
25       osx_image: xcode12
26       compiler: gcc
27       env:
28         - COMPILER=g++
29         - COMP=gcc
30
31     - os: osx
32       osx_image: xcode12
33       compiler: clang
34       env:
35         - COMPILER=clang++
36         - COMP=clang
37
38 branches:
39   only:
40    - master
41
42 before_script:
43   - cd src
44
45 script:
46   # Obtain bench reference from git log
47   - git log HEAD | grep "\b[Bb]ench[ :]\+[0-9]\{7\}" | head -n 1 | sed "s/[^0-9]*\([0-9]*\).*/\1/g" > git_sig
48   - export benchref=$(cat git_sig)
49   - echo "Reference bench:" $benchref
50
51   #
52   # Compiler version string
53   - $COMPILER -v
54
55   #
56   # Verify bench number against various builds
57   - export CXXFLAGS="-Werror -D_GLIBCXX_DEBUG"
58   - make clean && make -j2 ARCH=x86-64 optimize=no debug=yes build && ../tests/signature.sh $benchref
59   - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make clean && make -j2 ARCH=x86-32 optimize=no debug=yes build && ../tests/signature.sh $benchref; fi
60   - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make clean && make -j2 ARCH=x86-32 build && ../tests/signature.sh $benchref; fi
61
62   #
63   # Check perft and reproducible search
64   - export CXXFLAGS="-Werror"
65   - make clean && make -j2 ARCH=x86-64 build
66   - ../tests/perft.sh
67   - ../tests/reprosearch.sh
68
69   #
70   # Valgrind
71   #
72   - export CXXFLAGS="-O1 -fno-inline"
73   - if [ -x "$(command -v valgrind )" ]; then make clean && make -j2 ARCH=x86-64 debug=yes optimize=no build > /dev/null && ../tests/instrumented.sh --valgrind; fi
74   - if [ -x "$(command -v valgrind )" ]; then ../tests/instrumented.sh --valgrind-thread; fi
75
76   #
77   # Sanitizer
78   #
79   - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make clean && make -j2 ARCH=x86-64 sanitize=undefined optimize=no debug=yes build > /dev/null && ../tests/instrumented.sh --sanitizer-undefined; fi
80   - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make clean && make -j2 ARCH=x86-64 sanitize=thread    optimize=no debug=yes build > /dev/null && ../tests/instrumented.sh --sanitizer-thread; fi