diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c0625f5..1a2e975a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: 'recursive' + persist-credentials: false - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: @@ -76,49 +77,45 @@ jobs: - name: Install dependencies (MacOS) if: matrix.os == 'macOS-latest' run: | - # Update Homebrew and install dependencies + # Update Homebrew; only install missing formulae (avoid tap conflicts) brew update - brew install git python3 cmake - - # Initialize and update submodules - git submodule update --init --recursive - - # Upgrade pip and install Python dependencies - python3 -m pip install --upgrade pip setuptools flake8 - python3 -m pip install -r requirements.txt + brew list --formula git >/dev/null 2>&1 || brew install git + brew list --formula cmake >/dev/null 2>&1 || brew install cmake + brew list --formula git-lfs >/dev/null 2>&1 || brew install git-lfs - PYTHON_VERSION=$(python -c "import sys; print(f'cp{sys.version_info.major}{sys.version_info.minor}')") + # Make LFS usable in this headless environment + git lfs install --skip-repo + git config --global credential.helper "" # avoid Keychain prompts + + # Use the actions/setup-python toolchain consistently + python -m pip install --upgrade pip setuptools flake8 + python -m pip install -r requirements.txt + PYTHON_VERSION=$(python -c "import sys; print(f'cp{sys.version_info.major}{sys.version_info.minor}')") export ARCHFLAGS="-arch arm64" export CMAKE_OSX_ARCHITECTURES=arm64 export CIBW_BUILD="${PYTHON_VERSION}-macosx_*" - - # Optional: print to confirm echo "ARCHFLAGS=$ARCHFLAGS" echo "CMAKE_OSX_ARCHITECTURES=$CMAKE_OSX_ARCHITECTURES" echo "CIBW_BUILD=$CIBW_BUILD" - - # Ensure delocate is installed - python3 -m pip install --upgrade cibuildwheel delocate + + python -m pip install --upgrade cibuildwheel delocate python -m cibuildwheel --platform macos - # Check the wheel for missing shared libraries + # Check wheel deps find wheelhouse -name '*.whl' -exec delocate-listdeps {} \; - - # Install the generated wheel - pip install wheelhouse/*.whl + + # Install the generated wheel into the SAME interpreter + python -m pip install wheelhouse/*.whl + + # Hide source tree so imports resolve to the wheel mv ssapy ssapy_src_backup - # List installed Python packages - python3 -m pip list + python -m pip list - name: Debug build artifacts run: | find . -name "*_ssapy*.so" - - name: Debug installed ssapy - run: | - python -c "import ssapy; print('ssapy is at:', ssapy.__file__)" - ls -l $(python -c "import ssapy; import os; print(os.path.dirname(ssapy.__file__))") #- name: Install dependencies (Windows) # if: matrix.os == 'windows-latest' # run: |