Skip to content

Commit

Permalink
CI Tweaks - #60
Browse files Browse the repository at this point in the history
CI Tweaks

Bench: 2134743
  • Loading branch information
SzilBalazs authored Aug 17, 2023
1 parent 524eee3 commit b685543
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 16 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
name: Check Bench & Run Tests
name: Validate Bench & Run Tests

on: [push]

jobs:
WhiteCore:
runs-on: ${{matrix.os}}
name: WhiteCore ${{matrix.arch}} ${{matrix.os}}
name: WhiteCore ${{matrix.compiler}} ${{matrix.arch}} ${{matrix.os}}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
arch: [popcnt, avx2, bmi2]
compiler: [g++, clang++]
include:
- os: ubuntu-latest
suffix: "-linux"
debug-build: "build=debug"
packages: |
sudo apt-get update
sudo apt-get install clang-15
sudo apt-get install -y valgrind clang-15 g++-multilib
- os: windows-latest
suffix: "-win"
exe-suffix: ".exe"
Expand All @@ -30,13 +33,14 @@ jobs:

- name: Build WhiteCore
run: |
clang++ --version
make EXE=WhiteCore-${{matrix.arch}}${{matrix.suffix}} ARCH=${{matrix.arch}}
${{matrix.compiler}} --version
make EXE=WhiteCore-${{matrix.arch}}${{matrix.suffix}} ARCH=${{matrix.arch}} CXX=${{matrix.compiler}} ${{matrix.debug-build}}
- name: Run tests
run: ./WhiteCore-${{matrix.arch}}${{matrix.suffix}} test

- name: Run bench
- name: Run bench on Windows
if: matrix.os == 'windows-latest'
run: ./WhiteCore-${{matrix.arch}}${{matrix.suffix}} bench

- name: Run bench on Linux
Expand All @@ -55,8 +59,13 @@ jobs:
echo "::error::The commit bench ${{steps.obtain_bench.outputs.COMMIT_BENCH}} is not equal to the actual bench ${{steps.obtain_bench.outputs.BENCH}}!"
exit 1
- name: Upload artifacts
- name: Run Valgrind
if: runner.os == 'Linux'
run: |
valgrind --error-exitcode=1 --errors-for-leak-kinds=all --leak-check=full ./WhiteCore-${{matrix.arch}}${{matrix.suffix}} bench
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: WhiteCore-Executables
name: WhiteCore-${{matrix.arch}}-${{matrix.compiler}}${{matrix.suffix}}${{matrix.exe-suffix}}
path: ./WhiteCore-${{matrix.arch}}${{matrix.suffix}}${{matrix.exe-suffix}}
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ else
endif

ifeq ($(uname_S), Windows)
SUFFIX = .exe

ifeq ($(CXX), clang++)
USE_INCBIN_TOOL = true
CPP_FILES += src/corenet.cpp
endif

SUFFIX = .exe
CP = powershell cp
else
CP = cp
Expand Down Expand Up @@ -97,13 +102,13 @@ $(TMP_EVALFILE):
@$(CP) $(EVALFILE) $(TMP_EVALFILE)

$(INCBIN_TOOL): $(TMP_EVALFILE)
ifeq ($(uname_S), Windows)
ifeq ($(USE_INCBIN_TOOL), true)
@echo -e "$(C_CYAN)Compiling $(C_RED)$(INCBIN_TOOL)$(C_CYAN)...$(C_DEFAULT)"
@clang -o $@ src/external/incbin/incbin.c
endif

$(OUTPUT_BINARY): $(HEADERS) $(SOURCES) $(INCBIN_TOOL)
ifeq ($(uname_S), Windows)
ifeq ($(USE_INCBIN_TOOL), true)
@./$(INCBIN_TOOL) src/network/nnue.h -o src/corenet.cpp
endif
@echo -e "$(C_CYAN)Compiling $(C_WHITE)$(NAME)$(C_CYAN)...$(C_DEFAULT)"
Expand Down
10 changes: 5 additions & 5 deletions src/chess/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,23 @@ namespace chess {
class Board {

public:
[[nodiscard]] constexpr Color get_stm() const {
[[nodiscard]] inline Color get_stm() const {
return state.stm;
}

[[nodiscard]] constexpr Square get_ep() const {
[[nodiscard]] inline Square get_ep() const {
return state.ep;
}

[[nodiscard]] constexpr Zobrist get_hash() const {
[[nodiscard]] inline Zobrist get_hash() const {
return state.hash;
}

[[nodiscard]] constexpr unsigned int get_move50() const {
[[nodiscard]] inline unsigned int get_move50() const {
return state.move50;
}

[[nodiscard]] constexpr CastlingRights get_rights() const {
[[nodiscard]] inline CastlingRights get_rights() const {
return state.rights;
}

Expand Down

0 comments on commit b685543

Please sign in to comment.