From 5aee25d1fe1930ac7b7e2eef1505c3f56e289aa0 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Sat, 14 Dec 2024 22:11:03 -0600
Subject: [PATCH] Update some Github CI wheel build infrastructure

---
 .github/workflows/wheels.yml | 6 +++---
 pyproject.toml               | 8 ++++++++
 scripts/build-ocl-macos.sh   | 4 ++--
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml
index a930ee84..661bb96d 100644
--- a/.github/workflows/wheels.yml
+++ b/.github/workflows/wheels.yml
@@ -18,7 +18,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        os: [ubuntu-20.04, windows-2019, macos-12]
+        os: [ubuntu-latest, windows-latest, macos-13, macos-14]
 
     steps:
       - uses: actions/checkout@v4
@@ -30,13 +30,13 @@ jobs:
           python-version: '3.x'
 
       - name: Install cibuildwheel
-        run: python -m pip install cibuildwheel==2.19.2
+        run: python -m pip install cibuildwheel==2.22.0
 
       - name: Build wheels
         shell: bash
         run: |
           set -x
-          if [[ "${{ matrix.os }}" == "windows-2019" ]]; then
+          if [[ ${{ matrix.os }} == windows-* ]]; then
             export CL_INC_DIR="D:/a/pyopencl/pyopencl/OpenCL-Headers/install/include"
             export CL_LIB_DIR="C:/Program Files/OpenCL-ICD-Loader/lib"
           fi
diff --git a/pyproject.toml b/pyproject.toml
index 34c15a93..8ed52801 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -154,6 +154,14 @@ test-command = "pytest {project}/test"
 test-extras = [
     "test",
 ]
+environment-pass = [
+    "CL_INC_DIR",
+    "CL_LIB_DIR",
+]
+test-skip = [
+    "*-macosx_*:arm64",
+    "*-macosx_arm64",
+]
 
 [tool.cibuildwheel.linux]
 skip = [
diff --git a/scripts/build-ocl-macos.sh b/scripts/build-ocl-macos.sh
index 9277c164..b17f8129 100644
--- a/scripts/build-ocl-macos.sh
+++ b/scripts/build-ocl-macos.sh
@@ -8,11 +8,11 @@ git clone --branch v2022.01.04 https://github.com/KhronosGroup/OpenCL-Headers
 
 
 
-cmake -D CMAKE_INSTALL_PREFIX=./OpenCL-Headers/install -S ./OpenCL-Headers -B ./OpenCL-Headers/build 
+cmake -D CMAKE_INSTALL_PREFIX=./OpenCL-Headers/install -S ./OpenCL-Headers -B ./OpenCL-Headers/build
 cmake --build ./OpenCL-Headers/build --target install
 
 cmake -D CMAKE_PREFIX_PATH=${PWD}/OpenCL-Headers/install -D OPENCL_ICD_LOADER_HEADERS_DIR=${PWD}/OpenCL-Headers/install/include -D CMAKE_INSTALL_PREFIX=./OpenCL-ICD-Loader/install -S ./OpenCL-ICD-Loader -B ./OpenCL-ICD-Loader/build 
 cmake --build ./OpenCL-ICD-Loader/build --target install --config Release
 
 echo "PyOpenCL wheel includes Khronos Group OpenCL-ICD-Loader which is licensed as below" >> ${SCRIPT_DIR}/../LICENSE
-cat ./OpenCL-ICD-Loader/LICENSE >> ${SCRIPT_DIR}/../LICENSE
\ No newline at end of file
+cat ./OpenCL-ICD-Loader/LICENSE >> ${SCRIPT_DIR}/../LICENSE
-- 
GitLab