diff --git a/.github/workflows/uci_compliance.yml b/.github/workflows/uci_compliance.yml new file mode 100644 index 00000000..34891961 --- /dev/null +++ b/.github/workflows/uci_compliance.yml @@ -0,0 +1,53 @@ +name: UCI Compliance +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - name: Rust stable + run: rustup default stable + - uses: actions/checkout@v4 + with: + lfs: true + + - name: Install just + uses: extractions/setup-just@v3 + + - name: Checkout fastchess + uses: actions/checkout@v4 + with: + repository: Disservin/fastchess + path: fast-chess + + - name: Get fastchess commit hash + id: fastchess-commit + run: echo "sha=$(cd fast-chess && git rev-parse HEAD)" >> $GITHUB_OUTPUT + + - name: Cache fastchess binary + uses: actions/cache@v4 + with: + path: fast-chess/fastchess + key: fastchess-${{ runner.os }}-${{ steps.fastchess-commit.outputs.sha }} + restore-keys: | + fastchess-${{ runner.os }}- + + - name: Build fastchess + run: | + cd fast-chess + make -j CXX=clang++ + + - name: Build byte-knight + run: just build-native-release byte-knight + + - name: Run UCI compliance tests + run: | + chmod +x ./fast-chess/fastchess + ./fast-chess/fastchess --compliance ./target/release/byte-knight