From c72d968287f789b7cac8a45e92922da7630d1226 Mon Sep 17 00:00:00 2001 From: kieferro <81773954+kieferro@users.noreply.github.com> Date: Wed, 6 Sep 2023 16:21:03 +0200 Subject: [PATCH] Use custom Stockfish builds for CI to test with different versions --- .github/workflows/ci.yml | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22ee424d..2aee3a17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,8 +13,9 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] - name: Python Linux ${{ matrix.python-version }} + python-version: ['3.8', '3.9', '3.10', '3.11'] + stockfish-tag: ['sf_15.1', 'sf_16'] + name: Python ${{ matrix.python-version }} - ${{ matrix.stockfish-tag }} - Linux steps: - uses: actions/checkout@v3 - name: Setup Python @@ -25,10 +26,28 @@ jobs: cache: 'pip' - name: Display Python version run: python --version - - name: Install dependencies + - name: Install python dependencies run: | python -m pip install --upgrade pip - sudo apt-get install stockfish + - name: Cache stockfish + uses: actions/cache@v3 + id: stockfish-cache + with: + path: ~/work/stockfish-bin/stockfish + key: ubuntu-${{ matrix.stockfish-tag }} + - name: Compile stockfish from Source + if: steps.stockfish-cache.outputs.cache-hit != 'true' + run: | + cd /tmp + git clone https://github.com/official-stockfish/Stockfish.git -b ${{ matrix.stockfish-tag }} + cd Stockfish/src + make -j profile-build ARCH=x86-64-avx2 + mkdir ~/work/stockfish-bin + mv ./stockfish ~/work/stockfish-bin/stockfish + - name: Add Stockfish to PATH + run: echo "$HOME/work/stockfish-bin" >> $GITHUB_PATH + - name: Display stockfish version + run: stockfish - name: Test with pytest run: | pip install pytest pytest-cov @@ -46,8 +65,8 @@ jobs: runs-on: windows-latest strategy: matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] - name: Python Windows ${{ matrix.python-version }} + python-version: ['3.8', '3.9', '3.10', '3.11'] + name: Python ${{ matrix.python-version }} - Windows steps: - uses: actions/checkout@v3 - name: Setup Python