CI/Builds: various updates #92
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: Builds | |
| # TODO: generalize steps | |
| env: | |
| DSS_CAPI_TAG: '0.15.0b2' | |
| ARTIFACTS_FOLDER: '${{ github.workspace }}/artifacts' | |
| on: | |
| # release: | |
| # types: [created] | |
| push: | |
| jobs: | |
| build_linux: | |
| name: 'Linux ${{ matrix.arch }} (${{ matrix.manylinux-base }})' | |
| continue-on-error: false | |
| strategy: | |
| matrix: | |
| include: | |
| - arch: x64 | |
| docker_image: 'quay.io/pypa/manylinux_2_28_x86_64' | |
| dss_extensions_linux32: '' | |
| gh_image: ubuntu-latest | |
| manylinux-base: 'manylinux_2_28' | |
| conda_subdir: 'linux-64' | |
| - arch: x64 | |
| docker_image: 'quay.io/pypa/manylinux2014_x86_64' | |
| dss_extensions_linux32: '' | |
| gh_image: ubuntu-latest | |
| manylinux-base: 'manylinux2014' | |
| conda_subdir: 'linux-64' | |
| - arch: x86 | |
| docker_image: 'quay.io/pypa/manylinux_2_34_i686' | |
| dss_extensions_linux32: linux32 | |
| gh_image: ubuntu-latest | |
| manylinux-base: 'manylinux2014' | |
| conda_subdir: 'linux-32' | |
| - arch: arm64 | |
| docker_image: 'quay.io/pypa/manylinux_2_28_aarch64' | |
| dss_extensions_linux32: '' | |
| gh_image: ubuntu-24.04-arm | |
| manylinux-base: 'manylinux_2_28' | |
| conda_subdir: 'linux-aarch64' | |
| - arch: arm64 | |
| docker_image: 'quay.io/pypa/manylinux2014_aarch64' | |
| dss_extensions_linux32: '' | |
| gh_image: ubuntu-24.04-arm | |
| manylinux-base: 'manylinux2014' | |
| conda_subdir: 'linux-aarch64' | |
| runs-on: ${{ matrix.gh_image }} | |
| env: | |
| CONDA_SUBDIR: '${{ matrix.conda_subdir }}' | |
| DSS_CAPI_PATH: '${{ github.workspace }}/dss_capi' | |
| CONDA: "/opt/miniconda/" | |
| DOCKER_IMAGE: '${{ matrix.docker_image }}' | |
| steps: | |
| - name: 'Checkout' | |
| run: | | |
| git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY dss_python_backend | |
| cd dss_python_backend | |
| git checkout $GITHUB_SHA | |
| - name: 'Setup Docker' | |
| run: | | |
| docker pull $DOCKER_IMAGE | |
| - name: 'Download/extract DSS C-API binaries' | |
| run: | | |
| curl -s -L https://github.com/dss-extensions/dss_capi/releases/download/${DSS_CAPI_TAG}/dss_capi_${DSS_CAPI_TAG}_linux_${{ matrix.arch }}.tar.gz -o dss_capi.tar.gz | |
| tar zxf dss_capi.tar.gz | |
| cd dss_python_backend/dss_python_backend | |
| - name: Build wheel | |
| run: | | |
| mkdir -p artifacts | |
| mkdir -p artifacts_raw | |
| docker run -e GITHUB_SHA -e GITHUB_REF -e DSS_CAPI_PATH=/build/dss_capi -v "${PWD}:/build" -w /build $DOCKER_IMAGE ${{ matrix.dss_extensions_linux32}} bash /build/dss_python_backend/ci/build_linux.sh ${{ matrix.arch }} | |
| ls -lh dss_python_backend/dss_python_backend | |
| # - name: Build conda packages | |
| # continue-on-error: false | |
| # run: | | |
| # bash dss_python_backend/ci/build_conda.sh | |
| - name: 'Upload artifacts' | |
| uses: "actions/upload-artifact@v4" | |
| with: | |
| name: 'packages-linux_${{ matrix.arch }}-${{ matrix.manylinux-base }}' | |
| path: '${{ github.workspace }}/artifacts' | |
| - name: Try installing the wheel | |
| continue-on-error: ${{ matrix.arch == 'x86' }} | |
| run: | | |
| docker run -e GITHUB_SHA -e GITHUB_REF -e DSS_CAPI_PATH=/build/dss_capi -v "${PWD}:/build" -w /build $DOCKER_IMAGE ${{ matrix.dss_extensions_linux32}} bash /build/dss_python_backend/ci/test_wheel.sh | |
| build_macos_x64: | |
| name: 'macOS x64' | |
| continue-on-error: false | |
| runs-on: 'macos-15-intel' | |
| env: | |
| DSS_CAPI_PATH: '${{ github.workspace }}/dss_capi' | |
| #SDKROOT: '${{ github.workspace }}/MacOSX10.13.sdk' | |
| PYTHON: python | |
| MACOSX_DEPLOYMENT_TARGET: "11.0" | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| path: 'dss_python_backend' | |
| - name: 'Download/extract DSS C-API binaries' | |
| run: | | |
| curl -s -L https://github.com/dss-extensions/dss_capi/releases/download/${DSS_CAPI_TAG}/dss_capi_${DSS_CAPI_TAG}_darwin_x64.tar.gz -o dss_capi.tar.gz | |
| tar zxf dss_capi.tar.gz | |
| cd dss_python_backend/dss_python_backend | |
| # - name: 'Download macOS SDK 10.13' | |
| # run: | | |
| # curl -s -L https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.13.sdk.tar.xz -o macOSsdk.tar.xz | |
| # tar xf macOSsdk.tar.xz | |
| - name: 'Prepare Python' | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| cache: 'pip' | |
| - name: Prepare virtual environment | |
| run: | | |
| $PYTHON -m venv buildvenv | |
| - name: Build wheel | |
| run: | | |
| source buildvenv/bin/activate | |
| bash dss_python_backend/ci/build_wheel.sh | |
| # - name: Build conda packages | |
| # continue-on-error: false | |
| # run: | | |
| # sudo chown -R $UID $CONDA | |
| # bash dss_python_backend/ci/build_conda.sh | |
| - name: 'Upload artifacts' | |
| uses: "actions/upload-artifact@v4" | |
| with: | |
| name: 'packages-darwin_x64' | |
| path: '${{ github.workspace }}/artifacts' | |
| - name: Try installing the wheel | |
| continue-on-error: true | |
| shell: bash | |
| run: | | |
| python -m pip install artifacts/dss_python_backend-*.whl | |
| python -c 'from dss_python_backend import lib, ffi; lib.DSS_NewCircuit(ffi.NULL, b"test123"); assert ffi.string(lib.Circuit_Get_Name(ffi.NULL)) == b"test123"' | |
| python -c 'from dss_python_backend import _fastdss' | |
| build_macos_arm64: | |
| name: 'macOS ARM64' | |
| continue-on-error: false | |
| runs-on: 'macos-15' | |
| env: | |
| DSS_CAPI_PATH: '${{ github.workspace }}/dss_capi' | |
| # SDKROOT: '${{ github.workspace }}/MacOSX10.13.sdk' | |
| PYTHON: python | |
| _PYTHON_HOST_PLATFORM: macosx-11.0-arm64 | |
| ARCHFLAGS: '-arch arm64' | |
| MACOSX_DEPLOYMENT_TARGET: "11.0" | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| path: 'dss_python_backend' | |
| - name: 'Download/extract DSS C-API binaries' | |
| run: | | |
| curl -s -L https://github.com/dss-extensions/dss_capi/releases/download/${DSS_CAPI_TAG}/dss_capi_${DSS_CAPI_TAG}_darwin_arm64.tar.gz -o dss_capi.tar.gz | |
| tar zxf dss_capi.tar.gz | |
| cd dss_python_backend/dss_python_backend | |
| # - name: 'Download macOS SDK 10.13' | |
| # run: | | |
| # curl -s -L https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.13.sdk.tar.xz -o macOSsdk.tar.xz | |
| # tar xf macOSsdk.tar.xz | |
| - name: 'Prepare Python' | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| cache: 'pip' | |
| - name: Prepare virtual environment | |
| run: | | |
| python -m venv buildvenv | |
| - name: Build wheel | |
| run: | | |
| source buildvenv/bin/activate | |
| bash dss_python_backend/ci/build_wheel.sh | |
| # - name: Build conda packages | |
| # continue-on-error: false | |
| # run: | | |
| # sudo chown -R $UID $CONDA | |
| # bash dss_python_backend/ci/build_conda.sh | |
| - name: 'Upload artifacts' | |
| uses: "actions/upload-artifact@v4" | |
| with: | |
| name: 'packages-darwin_arm64' | |
| path: '${{ github.workspace }}/artifacts' | |
| - name: Try installing the wheel | |
| continue-on-error: true | |
| shell: bash | |
| run: | | |
| python -m pip install artifacts/dss_python_backend-*.whl | |
| python -c 'from dss_python_backend import lib, ffi; lib.DSS_NewCircuit(ffi.NULL, b"test123"); assert ffi.string(lib.Circuit_Get_Name(ffi.NULL)) == b"test123"' | |
| python -c 'from dss_python_backend import _fastdss' | |
| build_win_x64: | |
| name: 'Windows x64' | |
| continue-on-error: false | |
| runs-on: windows-2022 | |
| env: | |
| CONDA_SUBDIR: 'win-64' | |
| DSS_CAPI_PATH: '${{ github.workspace }}\dss_capi' | |
| PYTHON: python | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| path: 'dss_python_backend' | |
| - name: 'Download/extract DSS C-API binaries' | |
| shell: cmd | |
| run: | | |
| "c:\Program Files\Git\mingw64\bin\curl" -s -L https://github.com/dss-extensions/dss_capi/releases/download/%DSS_CAPI_TAG%/dss_capi_%DSS_CAPI_TAG%_win_x64.zip -o dss_capi.zip | |
| 7z x -y -o. dss_capi.zip | |
| cd dss_python_backend\dss_python_backend | |
| - name: Build wheel | |
| shell: bash | |
| run: | | |
| bash dss_python_backend/ci/build_wheel.sh | |
| # - name: Build conda packages | |
| # continue-on-error: false | |
| # shell: bash | |
| # run: | | |
| # bash dss_python_backend/ci/build_conda.sh | |
| - name: 'Upload artifacts' | |
| uses: "actions/upload-artifact@v4" | |
| with: | |
| name: 'packages-win_x64' | |
| path: '${{ github.workspace }}/artifacts' | |
| - name: Try installing the wheel | |
| continue-on-error: true | |
| shell: bash | |
| run: | | |
| python -m pip install artifacts/dss_python_backend-*.whl | |
| python -c "from dss_python_backend import lib, ffi; lib.DSS_NewCircuit(ffi.NULL, b'test123'); assert ffi.string(lib.Circuit_Get_Name(ffi.NULL)) == b'test123'" | |
| python -c "from dss_python_backend import _fastdss" | |
| build_win_x86: | |
| name: 'Windows x86' | |
| if: false | |
| continue-on-error: false | |
| runs-on: windows-2022 | |
| env: | |
| CONDA_SUBDIR: 'win-32' | |
| DSS_CAPI_PATH: '${{ github.workspace }}\dss_capi' | |
| PYTHON: python | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| path: 'dss_python_backend' | |
| - name: 'Setup Python' | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| cache: 'pip' | |
| architecture: 'x86' | |
| - name: 'Download/extract DSS C-API binaries' | |
| shell: cmd | |
| run: | | |
| "c:\Program Files\Git\mingw64\bin\curl" -s -L https://github.com/dss-extensions/dss_capi/releases/download/%DSS_CAPI_TAG%/dss_capi_%DSS_CAPI_TAG%_win_x86.zip -o dss_capi.zip | |
| 7z x -y -o. dss_capi.zip | |
| cd dss_python_backend\dss_python_backend | |
| - name: Build wheel | |
| shell: bash | |
| run: | | |
| bash dss_python_backend/ci/build_wheel.sh | |
| - name: 'Upload artifacts' | |
| uses: "actions/upload-artifact@v4" | |
| with: | |
| name: 'packages-win_x86' | |
| path: '${{ github.workspace }}/artifacts' | |
| - name: Try installing the wheel | |
| continue-on-error: true | |
| shell: bash | |
| run: | | |
| python -m pip install artifacts/dss_python_backend-*.whl | |
| python -c "from dss_python_backend import lib, ffi; lib.DSS_NewCircuit(ffi.NULL, b'test123'); assert ffi.string(lib.Circuit_Get_Name(ffi.NULL)) == b'test123'" | |
| python -c "from dss_python_backend import _fastdss" | |
| merge: | |
| name: 'Merge build artifacts' | |
| continue-on-error: false | |
| runs-on: ubuntu-latest | |
| # needs: [build_linux, build_macos_arm64, build_macos_x64, build_win_x64, build_win_x86] | |
| needs: [build_linux, build_macos_arm64, build_macos_x64, build_win_x64] | |
| steps: | |
| - name: Merge Artifacts | |
| uses: actions/upload-artifact/merge@v4 | |
| with: | |
| name: dss_python_backend-builds | |
| pattern: packages-* | |
| # delete-merged: true |