Add website example source files to the CMake build for validation (#… #5
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: Python wheels | |
on: | |
push: | |
branches: [ $default-branch, main, python ] | |
jobs: | |
build_wheels: | |
name: Build Python wheels | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-22.04, windows-latest, macOS-latest] | |
env: | |
# Skip 32-bit wheels builds | |
CIBW_SKIP: "*-win32 *_i686" | |
CIBW_BEFORE_BUILD: > | |
echo "Installing Zlib..." && | |
cd zlib.build && | |
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../openexr.install -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_PREFIX_PATH=../openexr.install -DCMAKE_INSTALL_LIBDIR=lib ../zlib && | |
cmake --build ./ --config Release --clean-first && | |
cmake --install ./ --config Release && | |
cd .. && | |
echo "Installing libDeflate..." && | |
cd libdeflate.build && | |
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../openexr.install -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_PREFIX_PATH=../openexr.install -DCMAKE_INSTALL_LIBDIR=lib -DLIBDEFLATE_BUILD_SHARED_LIB=OFF -DLIBDEFLATE_USE_SHARED_LIB=OFF -DBUILD_SHARED_LIBS=OFF ../libdeflate && | |
cmake --build ./ --config Release --clean-first && | |
cmake --install ./ --config Release && | |
cd .. && | |
echo "Installing Imath-3.1.9..." && | |
cd imath.build && | |
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../openexr.install -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_PREFIX_PATH=../openexr.install -DCMAKE_INSTALL_LIBDIR=lib -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF ../imath && | |
cmake --build ./ --config Release --clean-first && | |
cmake --install ./ --config Release && | |
cd .. && | |
echo "Installing OpenEXR..." && | |
cd openexr.build && | |
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../openexr.install -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_PREFIX_PATH=../openexr.install -DCMAKE_INSTALL_LIBDIR=lib -DBUILD_TESTING=OFF -DOPENEXR_INSTALL_EXAMPLES=OFF -DBUILD_SHARED_LIBS=OFF -DOPENEXR_FORCE_INTERNAL_DEFLATE=ON ../ && | |
cmake --build ./ --config Release --clean-first && | |
cmake --install ./ --config Release && | |
cd .. | |
CIBW_TEST_REQUIRES: pytest | |
CIBW_TEST_COMMAND: pytest {project}/src/wrappers/python/tests/ | |
steps: | |
- uses: actions/checkout@v3 | |
# Used to host cibuildwheel | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install cibuildwheel | |
run: python -m pip install cibuildwheel==2.8.1 | |
- name: Create setup.py | |
run: | | |
mv ${{github.workspace}}/src/wrappers/python/setup.py ${{github.workspace}}/setup.py | |
mv ${{github.workspace}}/src/wrappers/python/Imath.py ${{github.workspace}}/Imath.py | |
mv ${{github.workspace}}/src/wrappers/python/OpenEXR.cpp ${{github.workspace}}/OpenEXR.cpp | |
- name: Create folders | |
run: | | |
mkdir -p ${{github.workspace}}/zlib.build | |
mkdir -p ${{github.workspace}}/libdeflate.build | |
mkdir -p ${{github.workspace}}/imath.build | |
mkdir -p ${{github.workspace}}/openexr.build | |
mkdir -p ${{github.workspace}}/openexr.install | |
- name: download Zlib source code | |
uses: suisei-cn/[email protected] | |
with: | |
url: https://github.com/madler/zlib/releases/download/v1.2.13/zlib-1.2.13.tar.gz | |
target: ${{github.workspace}}/ | |
- name: Extract Zlib | |
run: | | |
tar -xvzf zlib-1.2.13.tar.gz -C ${{github.workspace}}/ | |
mv zlib-1.2.13 zlib | |
rm zlib-1.2.13.tar.gz | |
- name: download libDeflate source code | |
uses: suisei-cn/[email protected] | |
with: | |
url: https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.18.tar.gz | |
target: ${{github.workspace}}/ | |
- name: Extract libDeflate | |
run: | | |
tar -xvzf v1.18.tar.gz -C ${{github.workspace}}/ | |
mv libdeflate-1.18 libdeflate | |
rm v1.18.tar.gz | |
- name: Patch libDeflate | |
run: | | |
patch -u libdeflate/CMakeLists.txt -i ${{github.workspace}}/src/wrappers/python/libdeflate.patch | |
- name: download Imath source code | |
uses: suisei-cn/[email protected] | |
with: | |
url: https://github.com/AcademySoftwareFoundation/Imath/archive/refs/tags/v3.1.9.tar.gz | |
target: ${{github.workspace}}/ | |
- name: Extract Imath | |
run: | | |
tar -xvzf v3.1.9.tar.gz -C ${{github.workspace}}/ | |
mv Imath-3.1.9 imath | |
rm v3.1.9.tar.gz | |
- name: Build wheels | |
run: python -m cibuildwheel --output-dir wheelhouse | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: "Python wheels" | |
path: ./wheelhouse/*.whl |