Skip to content

matplotlib: add build, test workflows for riscv64 #3

matplotlib: add build, test workflows for riscv64

matplotlib: add build, test workflows for riscv64 #3

---
name: Build matplotlib wheels (riscv64)
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
permissions: {}
jobs:
build_sdist:
name: Build sdist
runs-on: ubuntu-24.04-riscv
permissions:
contents: read
outputs:
SDIST_NAME: ${{ steps.sdist.outputs.SDIST_NAME }}
steps:
- name: Checkout python-wheels
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Checkout matplotlib
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: matplotlib/matplotlib
path: upstream
fetch-depth: 0
persist-credentials: false
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
name: Install Python
with:
python-version: '3.12'
activate-environment: true
enable-cache: false
# Something changed somewhere that prevents the downloaded-at-build-time
# licenses from being included in built wheels, so pre-download them so
# that they exist before the build and are included.
- name: Pre-download bundled licenses
working-directory: upstream
run: >
curl -Lo LICENSE/LICENSE_QHULL
https://github.com/qhull/qhull/raw/2020.2/COPYING.txt
- name: Install dependencies
run: uv pip install build twine
- name: Build sdist
id: sdist
working-directory: upstream
run: |
python -m build --sdist
python ci/export_sdist_name.py
- name: Check README rendering for PyPI
working-directory: upstream
run: twine check dist/*
- name: Upload sdist result
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: cibw-sdist
path: upstream/dist/*.tar.gz
if-no-files-found: error
build_wheels:
needs: build_sdist
name: Build wheels on ubuntu-24.04-riscv for riscv64
permissions:
contents: read
runs-on: ubuntu-24.04-riscv
steps:
- name: Checkout python-wheels
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Download sdist
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: cibw-sdist
path: dist/
- name: Build wheels for CPython 3.14
uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1
with:
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
env:
CIBW_BUILD: "cp314-* cp314t-*"
CIBW_ARCHS: "riscv64"
CIBW_ENVIRONMENT: 'PIP_PREFER_BINARY=1 PIP_EXTRA_INDEX_URL=https://gitlab.com/api/v4/projects/riseproject%2Fpython%2Fwheel_builder/packages/pypi/simple'
- name: Build wheels for CPython 3.13
uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1
with:
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
env:
CIBW_BUILD: "cp313-*"
CIBW_ARCHS: "riscv64"
CIBW_ENVIRONMENT: 'PIP_PREFER_BINARY=1 PIP_EXTRA_INDEX_URL=https://gitlab.com/api/v4/projects/riseproject%2Fpython%2Fwheel_builder/packages/pypi/simple'
- name: Build wheels for CPython 3.12
uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1
with:
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
env:
CIBW_BUILD: "cp312-*"
CIBW_ARCHS: "riscv64"
CIBW_ENVIRONMENT: 'PIP_PREFER_BINARY=1 PIP_EXTRA_INDEX_URL=https://gitlab.com/api/v4/projects/riseproject%2Fpython%2Fwheel_builder/packages/pypi/simple'
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: cibw-wheels-${{ runner.os }}-riscv64
path: ./wheelhouse/*.whl
if-no-files-found: error