cibuildwheel #514
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: cibuildwheel | |
| on: | |
| push: | |
| paths: | |
| - '.github/workflows/cibuildwheel.yml' | |
| - 'build_config/pyproject/*.toml' | |
| workflow_dispatch: | |
| inputs: | |
| os: | |
| type: string | |
| description: "comma separated list of OS" | |
| required: false | |
| workflow_call: | |
| inputs: | |
| os: | |
| type: string | |
| required: false | |
| schedule: | |
| - cron: '5 0 * * *' | |
| jobs: | |
| generate-matrix: | |
| uses: ./.github/workflows/generate-matrix.yml | |
| with: | |
| os: ${{ inputs.os }} | |
| ################### | |
| # building pure python wheels | |
| ################### | |
| pure-python-wheels: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Cloning SUMO | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| filter: tree:0 | |
| # to work around actions/checkout#1467 | |
| ref: ${{ github.ref }} | |
| - name: Building sumolib and traci wheels | |
| run: | | |
| python -m pip install build | |
| python tools/build_config/version.py --pep440 build_config/pyproject/sumolib.toml pyproject.toml | |
| python -m build | |
| python tools/build_config/version.py --pep440 build_config/pyproject/traci.toml pyproject.toml | |
| python -m build | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: cibw-pure-wheels | |
| path: ./dist/* | |
| ################### | |
| # building wheels with cibuildwheel | |
| ################### | |
| build-wheels: | |
| needs: [generate-matrix] | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJSON(needs.generate-matrix.outputs.build_matrix) }} | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| SUMO_LIBRARIES: D:\a\sumo\sumo\SUMOLibraries | |
| steps: | |
| - name: Cloning SUMO | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| filter: tree:0 | |
| # to work around actions/checkout#1467 | |
| ref: ${{ github.ref }} | |
| - name: Cloning SUMO Libraries | |
| if: matrix.os == 'windows-latest' | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: DLR-TS/SUMOLibraries | |
| path: SUMOLibraries | |
| - name: "Set up MSVC Developer Command Prompt" | |
| if: matrix.os == 'windows-latest' | |
| uses: compnerd/gha-setup-vsdevenv@v6 | |
| - name: ccache | |
| uses: hendrikmuhs/ccache-action@v1.2 | |
| with: | |
| key: ${{ matrix.os }}-${{ matrix.manylinux }} | |
| variant: ${{ matrix.os == 'windows-latest' && 'sccache' || 'ccache' }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.12' | |
| - name: Set up Java | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| cache: 'maven' | |
| - name: Preparing wheel eclipse-sumo | |
| run: python tools/build_config/version.py --pep440 build_config/pyproject/eclipse-sumo.toml pyproject.toml | |
| - name: Building wheel eclipse-sumo | |
| uses: pypa/cibuildwheel@v3.3.1 | |
| env: | |
| CIBW_ENVIRONMENT_LINUX: "CCACHE_DIR=/host/home/runner/work/sumo/sumo/.ccache" | |
| CIBW_ENVIRONMENT_WINDOWS: "CMAKE_GENERATOR=Ninja" | |
| CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux }} | |
| CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.manylinux }} | |
| CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9" | |
| MACOSX_DEPLOYMENT_TARGET: '14.0' | |
| - name: Preparing wheel sumo-data | |
| run: python tools/build_config/version.py --pep440 build_config/pyproject/sumo-data.toml pyproject.toml | |
| - name: Building wheel sumo-data | |
| uses: pypa/cibuildwheel@v3.3.1 | |
| env: | |
| CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux }} | |
| CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.manylinux }} | |
| CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9" | |
| CIBW_REPAIR_WHEEL_COMMAND: "" # disable repair, no relocatable binaries inside | |
| MACOSX_DEPLOYMENT_TARGET: '14.0' | |
| - name: Preparing wheel libsumo | |
| run: python tools/build_config/version.py --pep440 build_config/pyproject/libsumo.toml pyproject.toml | |
| - name: Building wheel libsumo | |
| uses: pypa/cibuildwheel@v3.3.1 | |
| env: | |
| CIBW_ENVIRONMENT_LINUX: "CCACHE_DIR=/host/home/runner/work/sumo/sumo/.ccache" | |
| CIBW_ENVIRONMENT_WINDOWS: "CMAKE_GENERATOR=Ninja" | |
| CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux }} | |
| CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.manylinux }} | |
| CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9" | |
| # CIBW_REPAIR_WHEEL_COMMAND_MACOS: "" # disable repair process to inspect the wheel | |
| # CIBW_BUILD_VERBOSITY: 2 | |
| MACOSX_DEPLOYMENT_TARGET: '14.0' | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: cibw-wheels-${{ matrix.os }}-${{ matrix.manylinux }} | |
| path: ./wheelhouse/*.whl | |
| # to download the unrepaired wheels, use the "dist" path | |
| ################### | |
| # testing wheels | |
| ################### | |
| test-wheels: | |
| needs: [pure-python-wheels, build-wheels] | |
| uses: ./.github/workflows/test-wheels.yml | |
| with: | |
| os: ${{ inputs.os }} | |
| wheel_source: 'python-wheels' |