Merge pull request #9 from jmelo11/jmelo11-patch-2 #62
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: Build wheels | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
jobs: | ||
build_wheels_linux: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
CIBW_BEFORE_BUILD_LINUX: >- | ||
cd repos/pybind11 && mkdir build && && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX='/install' -DCMAKE_PREFIX_PATH='/install' -DBUILD_TESTING=OFF && | ||
cmake --build . --config ${{env.BUILD_TYPE}} --target install && cd ../../ && | ||
cd repos/XAD build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DXAD_SIMD_OPTION='SSE' -DXAD_ENABLE_TESTS=OFF -DCMAKE_INSTALL_PREFIX='/install' -DCMAKE_PREFIX_PATH='/install' && | ||
cmake --build . --config ${{env.BUILD_TYPE}} --target install && cd ../../ && | ||
cd repos/QuantLib && mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DQL_BUILD_BENCHMARK=OFF -DQL_BUILD_EXAMPLES=OFF -DQL_BUILD_TEST_SUITE=OFF -DQL_TAGGED_LAYOUT=OFF -DBOOST_ROOT=/usr -DCMAKE_INSTALL_PREFIX='/install' -DCMAKE_PREFIX_PATH='/install' && | ||
cmake --build . --config ${{env.BUILD_TYPE}} --target install && cd ../../ && | ||
mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX='/install' -DCMAKE_PREFIX_PATH='/install' -DBUILD_BENCHMARK=OFF -DBUILD_EXAMPLES=OFF && | ||
cmake --build . --config ${{env.BUILD_TYPE}} --target install | ||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-20.04 | ||
cibw_archs: "x86_64" | ||
- os: ubuntu-20.04 | ||
cibw_archs: "aarch64" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup | ||
run: | | ||
sudo apt update | ||
sudo apt install -y libboost-dev ninja-build cmake | ||
sudo apt install -y python3 python3-pip | ||
pip3 install setuptools wheel twine pybind11 cibuildwheel | ||
- name: Build and upload Python package | ||
working-directory: ${{github.workspace}} | ||
run: | | ||
python3 -m python/setup.py cibuildwheel --output-dir python/wheelhouse | ||
python3 -m twine upload --skip-existing python/wheelhouse/* -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} | ||
env: | ||
CIBW_ENVIRONMENT: INSTALL_DIR=/host/${{env.INSTALL_DIR}} | ||
cd repos/pybind11 && mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX='/install' -DCMAKE_PREFIX_PATH='/install' -DBUILD_TESTING=OFF && | ||
cmake --build . --config Release --target install && cd ../../../ && | ||
cd repos/XAD && mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DXAD_SIMD_OPTION='SSE' -DXAD_ENABLE_TESTS=OFF -DCMAKE_INSTALL_PREFIX='/install' -DCMAKE_PREFIX_PATH='/install' && | ||
cmake --build . --config Release --target install && cd ../../../ && | ||
cd repos/QuantLib && mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DQL_BUILD_BENCHMARK=OFF -DQL_BUILD_EXAMPLES=OFF -DQL_BUILD_TEST_SUITE=OFF -DQL_TAGGED_LAYOUT=OFF -DBOOST_ROOT=/usr -DCMAKE_INSTALL_PREFIX='/install' -DCMAKE_PREFIX_PATH='/install' && | ||
cmake --build . --config Release --target install && cd ../../../ && | ||
mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX='/install' -DCMAKE_PREFIX_PATH='/install' -DBUILD_BENCHMARK=OFF -DBUILD_EXAMPLES=OFF && | ||
cmake --build . --config Release --target install | ||
cibuildwheel --platform linux python/ |