matplotlib: add build, test workflows for riscv64 #5
Workflow file for this run
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: Build matplotlib wheels (riscv64) | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| permissions: {} | |
| env: | |
| # Query PyPI + gitlab riscv64 mirror; pick best compatible wheel | |
| # (`unsafe-best-match` = pip-like). `first-index` stops at PyPI for sdist | |
| # packages like cffi, never consulting gitlab for the riscv64 wheel. | |
| UV_EXTRA_INDEX_URL: https://gitlab.com/api/v4/projects/riseproject%2Fpython%2Fwheel_builder/packages/pypi/simple | |
| UV_INDEX_STRATEGY: unsafe-best-match | |
| # Refuse sdist for dependencies — wheels only. Forces uv to pick the gitlab | |
| # riscv64 wheel instead of falling back to building cffi/cryptography/etc. | |
| UV_ONLY_BINARY: ':all:' | |
| 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_BUILD_FRONTEND: "build[uv]" | |
| CIBW_ENVIRONMENT: >- | |
| UV_EXTRA_INDEX_URL=https://gitlab.com/api/v4/projects/riseproject%2Fpython%2Fwheel_builder/packages/pypi/simple | |
| UV_INDEX_STRATEGY=unsafe-best-match | |
| UV_ONLY_BINARY=:all: | |
| - 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_BUILD_FRONTEND: "build[uv]" | |
| CIBW_ENVIRONMENT: >- | |
| UV_EXTRA_INDEX_URL=https://gitlab.com/api/v4/projects/riseproject%2Fpython%2Fwheel_builder/packages/pypi/simple | |
| UV_INDEX_STRATEGY=unsafe-best-match | |
| UV_ONLY_BINARY=:all: | |
| - 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_BUILD_FRONTEND: "build[uv]" | |
| CIBW_ENVIRONMENT: >- | |
| UV_EXTRA_INDEX_URL=https://gitlab.com/api/v4/projects/riseproject%2Fpython%2Fwheel_builder/packages/pypi/simple | |
| UV_INDEX_STRATEGY=unsafe-best-match | |
| UV_ONLY_BINARY=:all: | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: cibw-wheels-${{ runner.os }}-riscv64 | |
| path: ./wheelhouse/*.whl | |
| if-no-files-found: error |