diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 78944d4f..e6434de5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -143,9 +143,20 @@ jobs: - { spec: cp315-manylinux_s390x, arch: s390x, test_args: '{package}/src/c', omit: ${{ env.skip_slow_jobs }} } - { spec: cp315t-manylinux_s390x, arch: s390x, test_args: '{package}/src/c', omit: ${{ env.skip_slow_jobs }} } + # riscv64 manylinux (native runners, so no need to trim the test suite + # or gate these behind skip_slow_jobs the way the emulated arches are) + - { spec: cp310-manylinux_riscv64, arch: riscv64, omit: ${{ env.skip_ci_redundant_jobs }} } + - { spec: cp311-manylinux_riscv64, arch: riscv64, omit: ${{ env.skip_ci_redundant_jobs }} } + - { spec: cp312-manylinux_riscv64, arch: riscv64, omit: ${{ env.skip_ci_redundant_jobs }} } + - { spec: cp313-manylinux_riscv64, arch: riscv64, omit: ${{ env.skip_ci_redundant_jobs }} } + - { spec: cp314-manylinux_riscv64, arch: riscv64, omit: ${{ env.skip_ci_redundant_jobs }} } + - { spec: cp314t-manylinux_riscv64, arch: riscv64, omit: ${{ env.skip_ci_redundant_jobs }} } + - { spec: cp315-manylinux_riscv64, arch: riscv64 } + - { spec: cp315t-manylinux_riscv64, arch: riscv64 } + linux: needs: [python_sdist, make_linux_matrix] - runs-on: ${{ (matrix.arch == 'aarch64') && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }} + runs-on: ${{ (matrix.arch == 'aarch64') && 'ubuntu-24.04-arm' || (matrix.arch == 'riscv64') && 'ubuntu-24.04-riscv' || 'ubuntu-24.04' }} strategy: fail-fast: false matrix: ${{ fromJSON(needs.make_linux_matrix.outputs.matrix_json) }} @@ -159,7 +170,13 @@ jobs: - name: configure docker foreign arch support uses: docker/setup-qemu-action@v4.2.0 - if: matrix.arch != 'x86_64' && matrix.arch != 'i686' && matrix.arch != 'aarch64' + if: matrix.arch != 'x86_64' && matrix.arch != 'i686' && matrix.arch != 'aarch64' && matrix.arch != 'riscv64' + + # the riscv64 runners have no preinstalled python that actions/setup-python + # can provide either, so fetch one with uv to drive cibuildwheel + - name: install uv (riscv64) + uses: astral-sh/setup-uv@v10.0.1 + if: matrix.arch == 'riscv64' - name: build/test wheels id: build @@ -184,6 +201,8 @@ jobs: CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.manylinux_img || 'manylinux2014' }} CIBW_MANYLINUX_PPC64LE_IMAGE: ${{ matrix.manylinux_img || 'manylinux2014' }} CIBW_MANYLINUX_S390X_IMAGE: ${{ matrix.manylinux_img || 'manylinux2014' }} + # manylinux_2_39 is the first manylinux spec with riscv64 images + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ matrix.manylinux_img || 'manylinux_2_39' }} CIBW_MUSLLINUX_X86_64_IMAGE: ${{ matrix.musllinux_img || 'musllinux_1_2' }} CIBW_MUSLLINUX_I686_IMAGE: ${{ matrix.musllinux_img || 'musllinux_1_2' }} CIBW_MUSLLINUX_AARCH64_IMAGE: ${{ matrix.musllinux_img || 'musllinux_1_2' }} @@ -195,10 +214,14 @@ jobs: mkdir cffi tar zxf ${{ steps.fetch_sdist.outputs.download-path }}/cffi*.tar.gz --strip-components=1 -C cffi - python -m pip install --upgrade "${{ matrix.cibw_version || 'cibuildwheel' }}" # actually build libffi + wheel (using env tweaks above) - python -m cibuildwheel --output-dir dist ./cffi + if [ "${{ matrix.arch }}" = "riscv64" ]; then + uvx --python 3.14 "${{ matrix.cibw_version || 'cibuildwheel' }}" --output-dir dist ./cffi + else + python -m pip install --upgrade "${{ matrix.cibw_version || 'cibuildwheel' }}" + python -m cibuildwheel --output-dir dist ./cffi + fi echo "artifact_name=$(ls ./dist/)" >> "$GITHUB_OUTPUT"