Skip to content
64 changes: 64 additions & 0 deletions .github/workflows/benchmark-riscv64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Benchmark riscv64 wheel build

on:
workflow_dispatch:

# Standalone riscv64-only wheel build for timing purposes.
# Bypasses the full CI pipeline (which requires a release to exist on the fork).
# Produces real build times on ubuntu-24.04-riscv (RISE native runner) for
# upstream discussion at jcrist/msgspec#987.

permissions:
contents: read

jobs:
sdist:
name: Build source distribution
runs-on: ubuntu-latest
outputs:
sdist-name: ${{ steps.build.outputs.sdist-name }}
steps:
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v7
- name: Build sdist
id: build
run: |
uv build --sdist
sdist_name=$(basename dist/*.tar.gz)
echo "sdist-name=${sdist_name}" >> "$GITHUB_OUTPUT"
- uses: actions/upload-artifact@v5
with:
name: artifact-sdist
path: dist/${{ steps.build.outputs.sdist-name }}
if-no-files-found: error

build-riscv64:
name: Build wheels on ubuntu-24.04-riscv for riscv64
needs: sdist
runs-on: ubuntu-24.04-riscv
env:
SDIST_NAME: ${{ needs.sdist.outputs.sdist-name }}
steps:
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v7
- name: Download source distribution
uses: actions/download-artifact@v6
with:
name: artifact-sdist
path: dist
- name: Build & Test Wheels (riscv64 native)
run: |
uvx cibuildwheel==3.2.1 \
--config-file "$GITHUB_WORKSPACE/.cibuildwheel.toml" \
--output-dir wheelhouse \
"dist/${SDIST_NAME}"
env:
CIBW_ARCHS: riscv64
# build[uv] from .cibuildwheel.toml requires uv inside the container,
# which is not pre-installed in the musllinux image. Override to pip.
CIBW_BUILD_FRONTEND: pip
- uses: actions/upload-artifact@v5
with:
name: artifact-wheels-riscv64
path: wheelhouse/*.whl
if-no-files-found: error
17 changes: 16 additions & 1 deletion .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
archs: aarch64
- os: ubuntu-latest
archs: x86_64
- os: ubuntu-24.04-riscv
archs: riscv64
- os: macos-latest
archs: arm64
- os: macos-15-intel
Expand All @@ -48,10 +50,23 @@ jobs:
# TODO: Remove this once the action supports specifying extras, see:
# https://github.com/pypa/cibuildwheel/pull/2630
- name: Install uv
if: runner.os != 'Linux'
if: runner.os != 'Linux' || matrix.archs == 'riscv64'
uses: astral-sh/setup-uv@v7

# On riscv64 the pypa/cibuildwheel action calls actions/setup-python
# internally, which has no riscv64 binaries. Run cibuildwheel via uvx
# instead. Keep version in sync with pypa/cibuildwheel@v3.2.1 below.
- name: Build & Test Wheels (riscv64 native)
if: matrix.archs == 'riscv64'
run: |
uvx cibuildwheel==3.2.1 --output-dir wheelhouse \
dist/${{ inputs.sdist-name }}
env:
CIBW_ARCHS: riscv64
CIBW_CONFIG_FILE: ${{ github.workspace }}/.cibuildwheel.toml

- name: Build & Test Wheels
if: matrix.archs != 'riscv64'
uses: pypa/cibuildwheel@v3.2.1
with:
config-file: .cibuildwheel.toml
Expand Down
Loading