Skip to content

Build wheels in workflow #10

Build wheels in workflow

Build wheels in workflow #10

Workflow file for this run

name: Wheel
on: [ push, pull_request ]
jobs:
generate-wheels-matrix:
name: Generate wheels matrix
runs-on: ubuntu-latest
outputs:
include: ${{ steps.set-matrix.outputs.include }}
steps:
- uses: actions/checkout@v3
- name: Install cibuildwheel
run: pipx install cibuildwheel==2.16.2
- id: set-matrix
run: |
MATRIX=$(
{
cibuildwheel --print-build-identifiers --platform linux \
| jq -nRc '{"only": inputs, "os": "ubuntu-latest"}'
} | jq -sc
)
echo "include=$MATRIX" >> $GITHUB_OUTPUT
env:
CIBW_ARCHS_LINUX: x86_64
build-wheels:
name: Build ${{ matrix.only }}
needs: generate-wheels-matrix
strategy:
matrix:
include: ${{ fromJson(needs.generate-wheels-matrix.outputs.include) }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Download libraries
uses: ./.github/composite-actions/download-libraries
with:
download-pybind: true
download-googletest: false
- name: Cache unpacked Boost
uses: actions/cache@v3
id: cache-unpacked-boost
with:
path: ${{github.workspace}}/lib/boost_1_78_0
key: ${{ runner.os }}-boost-for-wheels-78
- name: Download & Unpack Boost
run: |
cd ${{github.workspace}}/lib
wget -O boost_1_78_0.tar.gz https://sourceforge.net/projects/boost/files/boost/1.78.0/boost_1_78_0.tar.gz/download
ls -la
tar xzf boost_1_78_0.tar.gz
shell: bash
if: steps.cache-unpacked-boost.outputs.cache-hit != 'true'
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BEFORE_BUILD: |
cd lib/boost_1_78_0
./bootstrap.sh --prefix=/usr/local > /dev/null
./b2 install --prefix=/usr/local -with > /dev/null
CIBW_BEFORE_TEST: "cp test_input_data/WDC_satellites.csv src/python_bindings/"
CIBW_TEST_COMMAND: "python3 {project}/src/python_bindings/test_bindings.py"