adding cache for vcpkg #25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 🛠️ Build and test wheels | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build on ${{ matrix.os }} with Python ${{ matrix.python-version }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-22.04, macos-13, windows-2022] | |
| python-version: ["3.9", "3.10", "3.11", "3.12"] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Upgrade pip and install build tools | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build scikit-build-core pybind11 cibuildwheel | |
| # 🧩 Cache vcpkg on Windows | |
| - name: Restore vcpkg cache | |
| if: runner.os == 'Windows' | |
| id: cache-vcpkg | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| C:\vcpkg | |
| key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }} | |
| restore-keys: | | |
| vcpkg-${{ runner.os }}- | |
| - name: Install vcpkg dependencies (Windows only) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| $Env:VCPKG_ROOT = "C:\vcpkg" | |
| if (!(Test-Path $Env:VCPKG_ROOT)) { | |
| git clone https://github.com/microsoft/vcpkg $Env:VCPKG_ROOT | |
| & "$Env:VCPKG_ROOT\bootstrap-vcpkg.bat" | |
| } | |
| & "$Env:VCPKG_ROOT\vcpkg.exe" install yasm-tool:x86-windows cgal:x64-windows | |
| echo "VCPKG_ROOT=$Env:VCPKG_ROOT" >> $env:GITHUB_ENV | |
| # 🐧 Linux / macOS system deps | |
| - name: Install CGAL (Linux) | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y libcgal-dev libgmp-dev libmpfr-dev | |
| - name: Install CGAL (macOS) | |
| if: runner.os == 'macOS' | |
| run: brew install cgal gmp mpfr | |
| # 🧱 Build the wheel | |
| - name: Build wheel | |
| run: | | |
| pip install . | |
| python -c "import loop_cgal; print('✅ loop_cgal import successful')" | |
| # 🧪 Optional tests | |
| - name: Run basic tests | |
| run: | | |
| python -c "import loop_cgal; print(loop_cgal.__doc__)" |