macOS builds + Runner updates (#871)
authordpldgr <144766863+dpldgr@users.noreply.github.com>
Sun, 9 Mar 2025 14:45:52 +0000 (22:45 +0800)
committerGitHub <noreply@github.com>
Sun, 9 Mar 2025 14:45:52 +0000 (15:45 +0100)
.github/workflows/fairy.yml
.github/workflows/ffishjs.yml
.github/workflows/release.yml
.github/workflows/stockfish.yml
.github/workflows/wheels.yml
src/position.cpp

index 93789a2..312fb74 100644 (file)
@@ -18,15 +18,15 @@ jobs:
       matrix:
         config:
           - {
-              name: "Ubuntu 20.04 GCC",
-              os: ubuntu-20.04,
+              name: "Ubuntu 24.04 GCC",
+              os: ubuntu-24.04,
               compiler: g++,
               comp: gcc,
               run_expensive_tests: true
             }
           - {
-              name: "Ubuntu 20.04 Clang",
-              os: ubuntu-20.04,
+              name: "Ubuntu 24.04 Clang",
+              os: ubuntu-24.04,
               compiler: clang++,
               comp: clang,
               run_expensive_tests: false
index 23aa60b..00e36e9 100644 (file)
@@ -12,7 +12,7 @@ env:
 
 jobs:
   test:
-    runs-on: ubuntu-20.04
+    runs-on: ubuntu-24.04
 
     strategy:
       matrix:
@@ -45,7 +45,7 @@ jobs:
         run: npm test
 
   build:
-    runs-on: ubuntu-20.04
+    runs-on: ubuntu-24.04
     needs: [test]    #Building process must start after successful testing process
 
     strategy:
index 65a62b4..e8bc242 100644 (file)
@@ -43,7 +43,7 @@ jobs:
     strategy:
       matrix:
         arch: ["x86-64-bmi2", "x86-64-modern", "x86-64"]
-    runs-on: ubuntu-20.04
+    runs-on: ubuntu-24.04
 
     steps:
       - uses: actions/checkout@v4
@@ -64,3 +64,53 @@ jobs:
           path: src/fairy-stockfish*
           if-no-files-found: error
           compression-level: 9
+
+  macos:
+    strategy:
+      matrix:
+        arch: ["x86-64"]
+    runs-on: macos-13
+
+    steps:
+      - uses: actions/checkout@v4
+
+      - name: make
+        run: cd src && make clean && make -j build COMP=clang ARCH=${{ matrix.arch }} EXE=fairy-stockfish_${{ matrix.arch }} && strip fairy-stockfish_${{ matrix.arch }}
+
+      - name: make largeboards
+        run: cd src && make clean && make -j build COMP=clang ARCH=${{ matrix.arch }} EXE=fairy-stockfish-largeboards_${{ matrix.arch }} largeboards=yes && strip fairy-stockfish-largeboards_${{ matrix.arch }}
+
+      - name: make all
+        run: cd src && make clean && make -j build COMP=clang ARCH=${{ matrix.arch }} EXE=fairy-stockfish-all_${{ matrix.arch }} largeboards=yes all=yes && strip fairy-stockfish-all_${{ matrix.arch }}
+
+      - uses: actions/upload-artifact@v4
+        with:
+          name: fairy-stockfish-macos-${{ matrix.arch }}
+          path: src/fairy-stockfish*
+          if-no-files-found: error
+          compression-level: 9
+
+  macos-m1:
+    strategy:
+      matrix:
+        arch: ["apple-silicon"]
+    runs-on: macos-14
+
+    steps:
+      - uses: actions/checkout@v4
+
+      - name: make
+        run: cd src && make clean && make -j build COMP=clang ARCH=${{ matrix.arch }} EXE=fairy-stockfish_${{ matrix.arch }} && strip fairy-stockfish_${{ matrix.arch }}
+
+      - name: make largeboards
+        run: cd src && make clean && make -j build COMP=clang ARCH=${{ matrix.arch }} EXE=fairy-stockfish-largeboards_${{ matrix.arch }} largeboards=yes && strip fairy-stockfish-largeboards_${{ matrix.arch }}
+
+      - name: make all
+        run: cd src && make clean && make -j build COMP=clang ARCH=${{ matrix.arch }} EXE=fairy-stockfish-all_${{ matrix.arch }} largeboards=yes all=yes && strip fairy-stockfish-all_${{ matrix.arch }}
+
+      - uses: actions/upload-artifact@v4
+        with:
+          name: fairy-stockfish-macos-m1-${{ matrix.arch }}
+          path: src/fairy-stockfish*
+          if-no-files-found: error
+          compression-level: 9
index a1efcdf..1b3e47a 100644 (file)
@@ -21,15 +21,15 @@ jobs:
       matrix:
         config:
           - {
-              name: "Ubuntu 22.04 GCC",
-              os: ubuntu-22.04,
+              name: "Ubuntu 24.04 GCC",
+              os: ubuntu-24.04,
               compiler: g++,
               comp: gcc,
               run_expensive_tests: true
             }
           - {
-              name: "Ubuntu 20.04 Clang",
-              os: ubuntu-20.04,
+              name: "Ubuntu 24.04 Clang",
+              os: ubuntu-24.04,
               compiler: clang++,
               comp: clang,
               run_expensive_tests: false
index 7af44b1..f08f338 100644 (file)
@@ -14,7 +14,7 @@ jobs:
     runs-on: ${{ matrix.os }}
     strategy:
       matrix:
-        os: [ubuntu-20.04, windows-2019, macos-13]
+        os: [ubuntu-24.04, windows-2019, macos-13]
 
     steps:
       - uses: actions/checkout@v4
@@ -41,7 +41,7 @@ jobs:
 
   build_sdist:
     name: Build source distribution
-    runs-on: ubuntu-20.04
+    runs-on: ubuntu-24.04
     steps:
       - uses: actions/checkout@v4
       - uses: actions/setup-python@v5
index 5026a6f..eec715d 100644 (file)
@@ -185,7 +185,7 @@ void Position::init() {
   // Prepare the cuckoo tables
   std::memset(cuckoo, 0, sizeof(cuckoo));
   std::memset(cuckooMove, 0, sizeof(cuckooMove));
-  int count = 0;
+  [[maybe_unused]] int count = 0;
   for (Color c : {WHITE, BLACK})
       for (PieceSet ps = CHESS_PIECES & ~piece_set(PAWN); ps;)
       {
@@ -2856,7 +2856,7 @@ bool Position::is_immediate_game_end(Value& result, int ply) const {
           current |= newBitboard;
       }
   }
-  
+
   if (connect_nxn())
   {
       Bitboard connectors = connectPieces;