refactor: patch pyproject.toml
instead of using `SKBUILD_CONFIGURE_…
#87
This file contains 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: 🐍 Bindings | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
test-bindings: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
container: ${{ matrix.os == 'ubuntu-latest' && 'fedora:38' || null }} | |
name: "🐍 Test Bindings on ${{ matrix.os }}" | |
steps: | |
- name: 📥 Checkout | |
uses: actions/checkout@v3 | |
- name: 🖥️ Setup Environment | |
uses: ./.github/actions/setup | |
with: | |
container: ${{ matrix.os }} | |
install-vtk: false | |
- name: 🦥 Cache Dependencies | |
uses: actions/cache@v3 | |
with: | |
key: python-${{ matrix.os }} | |
path: build | |
- name: 🐍 Build and check Python Module (Windows) | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
python3 -m venv venv | |
./venv/Scripts/activate.bat | |
pip install . | |
python3 -c "import viennals2d; print(viennals2d.__doc__)" | |
- name: 🐍 Build and check Python Module (Other) | |
if: ${{ matrix.os != 'windows-latest' }} | |
run: | | |
python3 -m venv venv | |
./venv/bin/pip install . | |
./venv/bin/python -c "import viennals2d; print(viennals2d.__doc__)" | |
- name: 📦 Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Pre-Built (${{ matrix.os }}) | |
path: venv | |
package: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
container: ${{ matrix.os == 'ubuntu-latest' && 'fedora:38' || null }} | |
name: "🐍 Package Bindings on ${{ matrix.os }}" | |
steps: | |
- name: 📥 Checkout | |
uses: actions/checkout@v3 | |
- name: 🖥️ Setup Environment | |
uses: ./.github/actions/setup | |
with: | |
container: ${{ matrix.os }} | |
install-vtk: false | |
- uses: actions/setup-python@v3 | |
- name: 🛞 CIBuildWheel | |
run: python -m pip install cibuildwheel==2.17.0 | |
- name: 🛠️ Build VTK | |
if: ${{ matrix.os != 'ubuntu-latest' }} | |
run: sed -i 's/DVIENNALS_BUILD_PYTHON=ON"/\0,"-DVIENNALS_PACKAGE_PYTHON=ON"/g' pyproject.toml | |
- name: 🛠️ Use VTK-Python Libs | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: sed -i 's/DVIENNALS_BUILD_PYTHON=ON"/\0,"-DVIENNALS_VTK_PYTHON_LIBS=ON"/g' pyproject.toml | |
- name: 🏗️ Build Wheels | |
run: python -m cibuildwheel --output-dir wheelhouse | |
env: | |
CIBW_BUILD: cp310-* cp311-* cp312-* | |
- name: 📦 Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheel-${{ matrix.os }}-${{ strategy.job-index }} | |
path: ./wheelhouse/*.whl |