diff --git a/.github/workflows/build-faust-streaming.yml b/.github/workflows/build-faust-streaming.yml new file mode 100644 index 00000000000..eca37bd782b --- /dev/null +++ b/.github/workflows/build-faust-streaming.yml @@ -0,0 +1,119 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# Based on the `build_wheels`, `test-pytest` and `test-freethreading` jobs of +# https://github.com/faust-streaming/faust/blob/v0.15.3/.github/workflows/python-package.yml +name: Build faust-streaming wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'Version glob to (re)build; empty builds every version of docs/packages/faust-streaming.yaml not released yet' + required: false + default: '' + pull_request: + branches: [main] + paths: + - '.github/workflows/build-faust-streaming.yml' + - 'docs/packages/faust-streaming.yaml' + push: + branches: [main] + paths: + - '.github/workflows/build-faust-streaming.yml' + - 'docs/packages/faust-streaming.yaml' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read # to fetch code (actions/checkout) + +env: + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + with: + package: faust-streaming + version: ${{ inputs.version }} + + build_wheels: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + name: Build faust-streaming ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 120 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + python: ["cp312", "cp313", "cp314", "cp314t"] + + env: + FAUST_STREAMING_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout faust v${{ env.FAUST_STREAMING_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: faust-streaming/faust + ref: v${{ env.FAUST_STREAMING_VERSION }} + fetch-depth: 0 + persist-credentials: false + + - name: Build and test wheels + uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + with: + only: ${{ matrix.python }}-manylinux_riscv64 + env: + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + # The repo-root faust/ would otherwise shadow the installed wheel's extensions. + CIBW_TEST_SOURCES: tests pyproject.toml + # Upstream's test.txt minus its lint/publish tools, which is what freethreading.txt is. + CIBW_BEFORE_TEST: pip install -r {project}/requirements/freethreading.txt + CIBW_TEST_ENVIRONMENT: >- + FAUST_REQUIRE_CYTHON=1 + ${{ matrix.python == 'cp314t' && 'PYTHON_GIL=0' || '' }} + CIBW_TEST_COMMAND: >- + python -m pytest --no-cov tests/unit tests/functional + ${{ matrix.python != 'cp314t' && 'tests/integration tests/meticulous tests/regression' || '' }} + + - name: Verify the wheel ships the compiled extensions and licence + run: | + python3 - wheelhouse/*.whl <<'EOF' + import sys, zipfile + for whl in sys.argv[1:]: + names = zipfile.ZipFile(whl).namelist() + for mod in ("faust/_cython/windows", "faust/_cython/streams", + "faust/models/_cython/fields", "faust/transport/_cython/conductor"): + assert any(n.startswith(mod + ".") and n.endswith(".so") for n in names), (mod, names) + assert any(n.endswith(".dist-info/licenses/LICENSE") for n in names), names + print(whl, "ok") + EOF + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: faust-streaming-${{ env.FAUST_STREAMING_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: ./wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish faust-streaming ${{ matrix.version }} + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + permissions: + contents: write + pull-requests: write + uses: $/.github/workflows/_publish-wheel.yml + secrets: + app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }} + with: + artifact-pattern: faust-streaming-${{ matrix.version }}-*-manylinux_riscv64 diff --git a/docs/packages/faust-streaming.yaml b/docs/packages/faust-streaming.yaml new file mode 100644 index 00000000000..f1972d49c48 --- /dev/null +++ b/docs/packages/faust-streaming.yaml @@ -0,0 +1,5 @@ +package-name: faust-streaming +source-code: https://github.com/faust-streaming/faust +license: BSD-3-Clause +versions: +- version: 0.15.3