forked from niklasf/python-chess
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
99 lines (99 loc) · 4.89 KB
/
.travis.yml
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
dist: xenial
language: python
sudo: false
python:
- "3.5"
- "3.6"
- "3.7"
matrix:
include:
- python: "pypy3"
dist: trusty
- python: "3.7"
env: PERFT=1
cache:
directories:
- data/gaviota
- data/syzygy/suicide
before_cache:
- rm -f data/gaviota/travis_wait_*.log || true
- rm -f data/syzygy/suicide/travis_wait_*.log || true
before_install:
- | # Stockfish
if [[ $PERFT -ne 1 ]]; then
wget https://stockfish.s3.amazonaws.com/stockfish-10-linux.zip
unzip stockfish-10-linux.zip
mkdir -p bin
cp stockfish-10-linux/Linux/stockfish_10_x64_modern bin/stockfish
chmod +x bin/stockfish
export PATH="`pwd`/bin:${PATH}"
which stockfish || (echo $PATH && false)
fi
- | # Crafty
if [[ $PERFT -ne 1 ]]; then
git clone https://github.com/lazydroid/crafty-chess
cd crafty-chess
make unix-gcc
export PATH="`pwd`:${PATH}"
cd ..
fi
- | # Gaviota libgtb
if [[ $PERFT -ne 1 ]]; then
git clone https://github.com/michiguel/Gaviota-Tablebases.git --depth 1
cd Gaviota-Tablebases
make
export LD_LIBRARY_PATH="`pwd`:${LD_LIBRARY_PATH}"
cd ..
fi
- | # Gaviota tablebases
if [[ $PERFT -ne 1 ]]; then
cd data/gaviota
travis_wait wget --no-verbose --no-check-certificate --no-clobber --input-file TEST-SOURCE.txt
cd ../..
fi
- | # Suicide syzygy bases
if [[ $PERFT -ne 1 ]]; then
cd data/syzygy/suicide
travis_wait wget --no-verbose --no-check-certificate --no-clobber --input-file TEST-SOURCE.txt
cd ../../..
fi
install:
- pip install --upgrade pip wheel
- pip install --upgrade setuptools
- pip install coverage coveralls
- pip install -e .
script:
- # Unit tests
- if [[ $PERFT -ne 1 ]]; then coverage erase; fi
- if [[ $PERFT -ne 1 ]]; then coverage run --source chess test.py -vv SquareTestCase; fi
- if [[ $PERFT -ne 1 ]]; then coverage run --source chess --append test.py -vv MoveTestCase; fi
- if [[ $PERFT -ne 1 ]]; then coverage run --source chess --append test.py -vv PieceTestCase; fi
- if [[ $PERFT -ne 1 ]]; then coverage run --source chess --append test.py -vv BoardTestCase; fi
- if [[ $PERFT -ne 1 ]]; then coverage run --source chess --append test.py -vv LegalMoveGeneratorTestCase; fi
- if [[ $PERFT -ne 1 ]]; then coverage run --source chess --append test.py -vv BaseBoardTestCase; fi
- if [[ $PERFT -ne 1 ]]; then coverage run --source chess --append test.py -vv SquareSetTestCase; fi
- if [[ $PERFT -ne 1 ]]; then coverage run --source chess --append test.py -vv PolyglotTestCase; fi
- if [[ $PERFT -ne 1 ]]; then coverage run --source chess --append test.py -vv PgnTestCase; fi
- if [[ $PERFT -ne 1 ]]; then coverage run --source chess --append test.py -vv SyzygyTestCase; fi
- if [[ $PERFT -ne 1 ]]; then coverage run --source chess --append test.py -vv NativeGaviotaTestCase; fi
- if [[ $PERFT -ne 1 ]]; then coverage run --source chess --append test.py -vv GaviotaTestCase; fi
- if [[ $PERFT -ne 1 ]]; then coverage run --source chess --append test.py -vv SvgTestCase; fi
- if [[ $PERFT -ne 1 ]]; then coverage run --source chess --append test.py -vv SuicideTestCase; fi
- if [[ $PERFT -ne 1 ]]; then coverage run --source chess --append test.py -vv AtomicTestCase; fi
- if [[ $PERFT -ne 1 ]]; then coverage run --source chess --append test.py -vv RacingKingsTestCase; fi
- if [[ $PERFT -ne 1 ]]; then coverage run --source chess --append test.py -vv HordeTestCase; fi
- if [[ $PERFT -ne 1 ]]; then coverage run --source chess --append test.py -vv ThreeCheckTestCase; fi
- if [[ $PERFT -ne 1 ]]; then coverage run --source chess --append test.py -vv CrazyhouseTestCase; fi
- if [[ $PERFT -ne 1 ]]; then coverage run --source chess --append test.py -vv GiveawayTestCase; fi
- if [[ $PERFT -ne 1 ]]; then coverage run --source chess --append test.py -vv EngineTestCase; fi
- if [[ $PERFT -ne 1 ]]; then coverage run --source chess --append -m doctest README.rst --verbose; fi
- if [[ $PERFT -ne 1 ]]; then echo Unit tests complete; fi
- if [[ $PERFT -ne 1 ]]; then coveralls || [[ $? -eq 139 ]]; fi
- # Perft tests
- if [[ $PERFT -eq 1 ]]; then python examples/perft/perft.py -t 1 examples/perft/random.perft --max-nodes 10000; fi
- if [[ $PERFT -eq 1 ]]; then python examples/perft/perft.py -t 1 examples/perft/tricky.perft; fi
- if [[ $PERFT -eq 1 ]]; then python examples/perft/perft.py -t 1 --variant giveaway examples/perft/giveaway.perft; fi
- if [[ $PERFT -eq 1 ]]; then python examples/perft/perft.py -t 1 --variant atomic examples/perft/atomic.perft; fi
- if [[ $PERFT -eq 1 ]]; then python examples/perft/perft.py -t 1 --variant racingkings examples/perft/racingkings.perft; fi
- if [[ $PERFT -eq 1 ]]; then python examples/perft/perft.py -t 1 --variant horde examples/perft/horde.perft; fi
- if [[ $PERFT -eq 1 ]]; then python examples/perft/perft.py -t 1 --variant crazyhouse examples/perft/crazyhouse.perft; fi