Add workflow for variants
authorFabian Fichter <ianfab@users.noreply.github.com>
Sat, 19 Jun 2021 05:55:05 +0000 (07:55 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sat, 19 Jun 2021 05:55:05 +0000 (07:55 +0200)
.github/workflows/fairy.yml [new file with mode: 0644]
tests/perft.sh

diff --git a/.github/workflows/fairy.yml b/.github/workflows/fairy.yml
new file mode 100644 (file)
index 0000000..728d5d9
--- /dev/null
@@ -0,0 +1,82 @@
+name: fairy
+on:
+  push:
+    branches:
+      - master
+  pull_request:
+    branches:
+      - master
+jobs:
+  fairy:
+    name: ${{ matrix.config.name }}
+    runs-on: ${{ matrix.config.os }}
+    env:
+      COMPILER: ${{ matrix.config.compiler }}
+      COMP: ${{ matrix.config.comp }}
+      CXXFLAGS: "-Werror"
+    strategy:
+      matrix:
+        config:
+          - {
+              name: "Ubuntu 20.04 GCC",
+              os: ubuntu-20.04,
+              compiler: g++,
+              comp: gcc,
+              run_expensive_tests: true
+            }
+          - {
+              name: "Ubuntu 20.04 Clang",
+              os: ubuntu-20.04,
+              compiler: clang++,
+              comp: clang,
+              run_expensive_tests: false
+            }
+
+    defaults:
+      run:
+        working-directory: src
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          fetch-depth: 0
+
+      - name: Download required packages
+        run: |
+          sudo apt update
+          sudo apt install expect valgrind g++-multilib
+
+      - name: Download the used network from the fishtest framework
+        run: |
+          make net
+
+      - name: Test NNUE
+        run: |
+          make clean
+          make -j2 ARCH=x86-64 nnue=yes debug=yes build
+          ./stockfish bench
+
+      - name: Build all variants
+        run: |
+          make clean
+          make -j2 ARCH=x86-64 largeboards=yes all=yes debug=yes build
+
+      - name: Test protocols
+        run: |
+          ../tests/protocol.sh
+
+      - name: Test variant perft
+        run: |
+          ../tests/perft.sh all
+
+      - name: Test variant bench
+        run: |
+          ./stockfish bench xiangqi
+          ./stockfish bench shogi
+          ./stockfish bench capablanca
+          ./stockfish bench sittuyin
+
+      - name: Test 32bit largeboards
+        run: |
+          make clean
+          make -j2 ARCH=x86-32 largeboards=yes build
+          ../tests/perft.sh largeboard
index 847f48b..70a92a2 100755 (executable)
@@ -34,7 +34,7 @@ if [[ $1 == "" || $1 == "chess" ]]; then
 fi
 
 # variants
-if [[ $1 == "" || $1 == "variant" ]]; then
+if [[ $1 == "all" || $1 == "variant" ]]; then
   # small board
   expect perft.exp losalamos startpos 5 191846 > /dev/null
   expect perft.exp losalamos "fen 6/2P3/6/1K1k2/6/6 w - - 0 1" 6 187431 > /dev/null