Skip to content

README: fix env for UCI engine port #182

README: fix env for UCI engine port

README: fix env for UCI engine port #182

Workflow file for this run

name: Build
on: [push, pull_request]
jobs:
linux:
name: Build (${{ matrix.os }}, OTP-${{ matrix.otp_version }})
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
matrix:
otp_version: [20, 21, 22, 23, 24, 25, 26]
os: [ubuntu-latest]
container:
image: erlang:${{ matrix.otp_version }}
env:
STOCKFISH_VERSION: 14.1
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Extract branch name
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Get some info
run: |
pwd
whoami
- name: Install system packages
run: |
apt update
apt install socat -y
- name: Install Stockfish
run: |
export STOCKFISH_DIR=${HOME}/stockfish_${STOCKFISH_VERSION}_linux_x64
export STOCKFISH_PATH=${STOCKFISH_DIR}/stockfish_${STOCKFISH_VERSION}_linux_x64
rm -fr ${STOCKFISH_DIR}
rm -f ${STOCKFISH_DIR}.zip
curl https://stockfishchess.org/files/stockfish_${STOCKFISH_VERSION}_linux_x64.zip -o ${STOCKFISH_DIR}.zip
unzip ${STOCKFISH_DIR}.zip -d ${HOME}
chmod +x ${STOCKFISH_PATH}
socat TCP-LISTEN:9010,reuseaddr,fork EXEC:${STOCKFISH_PATH} &
- name: Cache Dialyzer PLTs
uses: actions/cache@v2
with:
path: |
~/.cache/rebar3/rebar3_*_plt
_build/default/rebar3_*_plt
key: ${{ runner.os }}-${{ steps.extract_branch.outputs.branch }}-otp-${{ matrix.otp_version }}-plt-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.config')) }}
restore-keys: |
${{ runner.os }}-${{ steps.extract_branch.outputs.branch }}-otp-${{ matrix.otp_version }}-plt-
- name: Cache Hex packages
uses: actions/cache@v2
with:
path: ~/.cache/rebar3/hex/hexpm/packages
key: ${{ runner.os }}-${{ steps.extract_branch.outputs.branch }}-otp-${{ matrix.otp_version }}-hex-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.lock')) }}
restore-keys: |
${{ runner.os }}-${{ steps.extract_branch.outputs.branch }}-otp-${{ matrix.otp_version }}-hex-
- name: Compile
run: rebar3 compile
- name: CT tests
run: |
export BINBO_UCI_ENGINE_PATH=${HOME}/stockfish_${STOCKFISH_VERSION}_linux_x64/stockfish_${STOCKFISH_VERSION}_linux_x64
export BINBO_UCI_ENGINE_HOST=localhost
export BINBO_UCI_ENGINE_PORT=9010
rebar3 ct
- name: Dialyzer
run: rebar3 dialyzer
- name: Code coverage
run: rebar3 cover
- name: Generate coverage report
run: rebar3 covertool generate
- name: Upload coverage to Codecov
run: bash <(curl -s https://codecov.io/bash) -f _build/test/covertool/binbo.covertool.xml
macos:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
matrix:
os: [macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Extract branch name
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Install Erlang
run: brew install erlang
- name: Install rebar3
run: brew install rebar3
- name: Install Stockfish
run: brew install stockfish
- name: Start Stockfish TCP Server
run: launchctl load test/helper-files/org.stockfish.x86.plist
- name: Cache Hex packages
uses: actions/cache@v2
with:
path: ~/.cache/rebar3/hex/hexpm/packages
key: ${{ runner.os }}-${{ steps.extract_branch.outputs.branch }}-hex-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.lock')) }}
restore-keys: |
${{ runner.os }}-${{ steps.extract_branch.outputs.branch }}-hex-
- name: Compile
run: rebar3 compile
- name: CT tests
run: |
export BINBO_UCI_ENGINE_PATH=/usr/local/bin/stockfish
export BINBO_UCI_ENGINE_HOST=localhost
export BINBO_UCI_ENGINE_PORT=9010
rebar3 ct
- name: Code coverage
run: rebar3 cover
windows:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
defaults:
run:
shell: powershell
strategy:
matrix:
os: [windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Erlang
run: choco install erlang -y
- name: Install rebar3
run: |
mkdir ~/rebar3-dl
Invoke-WebRequest -Uri https://github.com/erlang/rebar3/releases/download/3.18.0/rebar3 -OutFile ~/rebar3-dl/rebar3
Copy-Item -Path .\test\helper-files\rebar3.cmd -Destination ~/rebar3-dl/rebar3.cmd
- name: Install Stockfish
run: |
Invoke-WebRequest -Uri https://stockfishchess.org/files/stockfish_14.1_win_x64.zip -OutFile ~/stockfish_14.1_win_x64.zip
Expand-Archive -LiteralPath '~/stockfish_14.1_win_x64.zip' -DestinationPath ~/
- name: Cache Hex packages
uses: actions/cache@v2
with:
path: ~/.cache/rebar3/hex/hexpm/packages
key: ${{ runner.os }}-${{ steps.extract_branch.outputs.branch }}-hex-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.lock')) }}
restore-keys: |
${{ runner.os }}-${{ steps.extract_branch.outputs.branch }}-hex-
- name: Compile
run: ~/rebar3-dl/rebar3.cmd compile
- name: CT tests
run: |
$env:BINBO_UCI_ENGINE_PATH = (Resolve-Path '~/stockfish_14.1_win_x64/stockfish_14.1_win_x64.exe').Path.replace('\', '/')
echo "BINBO_UCI_ENGINE_PATH=$env:BINBO_UCI_ENGINE_PATH"
~/rebar3-dl/rebar3.cmd ct
- name: Code coverage
run: ~/rebar3-dl/rebar3.cmd cover