|
| 1 | +# Workflow to build and test wheels, similarly to numpy/numpy-release. |
| 2 | +# To work on these jobs in a fork, comment out: |
| 3 | +# |
| 4 | +# if: github.repository == 'numpy/numpy' |
| 5 | +name: Linux-riscv64 Wheel builder |
| 6 | + |
| 7 | +on: |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - main |
| 11 | + - maintenance/** |
| 12 | + paths-ignore: |
| 13 | + - '**.pyi' |
| 14 | + - '**.md' |
| 15 | + - '**.rst' |
| 16 | + - 'tools/stubtest/**' |
| 17 | + workflow_dispatch: |
| 18 | + |
| 19 | +concurrency: |
| 20 | + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 21 | + cancel-in-progress: true |
| 22 | + |
| 23 | +permissions: |
| 24 | + contents: read # to fetch code (actions/checkout) |
| 25 | + |
| 26 | +jobs: |
| 27 | + build_wheels: |
| 28 | + name: Build wheel ${{ matrix.python }}-manylinux_riscv64- |
| 29 | + # To enable this job on a fork, comment out: |
| 30 | + if: github.repository == 'numpy/numpy' |
| 31 | + runs-on: ubuntu-24.04-riscv |
| 32 | + strategy: |
| 33 | + fail-fast: false |
| 34 | + matrix: |
| 35 | + python: ["cp312"] |
| 36 | + |
| 37 | + env: |
| 38 | + CCACHE_DIR: ${{ github.workspace }}/.ccache |
| 39 | + CCACHE_BASEDIR: "/project" |
| 40 | + CCACHE_COMPILERCHECK: "content" |
| 41 | + steps: |
| 42 | + - name: Checkout numpy |
| 43 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 44 | + with: |
| 45 | + submodules: true |
| 46 | + persist-credentials: false |
| 47 | + |
| 48 | + - name: Restore compilation cache |
| 49 | + uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 |
| 50 | + id: ccache-restore |
| 51 | + with: |
| 52 | + path: ${{ env.CCACHE_DIR }} |
| 53 | + key: ccache-wheels-manylinux_riscv64-${{ matrix.python }}-${{ github.run_id }} |
| 54 | + restore-keys: | |
| 55 | + ccache-wheels-manylinux_riscv64-${{ matrix.python }}- |
| 56 | +
|
| 57 | + - name: Build wheels |
| 58 | + uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1 |
| 59 | + env: |
| 60 | + CIBW_BUILD: ${{ matrix.python }}-manylinux_riscv64 |
| 61 | + CIBW_BEFORE_ALL_LINUX: | |
| 62 | + set -eux |
| 63 | + CCACHE_VERSION=4.13.6 |
| 64 | + curl -fsSL https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}-linux-$(uname -m)-musl-static.tar.gz | \ |
| 65 | + tar -xvzf - --strip-components 1 -C /usr/local/bin ccache-${CCACHE_VERSION}-linux-$(uname -m)-musl-static/ccache |
| 66 | + ccache --version |
| 67 | + ccache --zero-stats |
| 68 | + CIBW_ENVIRONMENT_PASS_LINUX: >- |
| 69 | + CCACHE_BASEDIR |
| 70 | + CCACHE_COMPILERCHECK |
| 71 | + CIBW_CONTAINER_ENGINE: "docker; create_args: --volume ${{ env.CCACHE_DIR }}:/root/.ccache" |
| 72 | + |
| 73 | + - name: Save compilation cache |
| 74 | + if: always() && github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) |
| 75 | + uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 |
| 76 | + with: |
| 77 | + path: ${{ env.CCACHE_DIR }} |
| 78 | + key: ccache-wheels-manylinux_riscv64-${{ matrix.python }}-${{ github.run_id }} |
| 79 | + |
| 80 | + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 81 | + with: |
| 82 | + name: ${{ matrix.python }}-manylinux_riscv64- |
| 83 | + path: ./wheelhouse/*.whl |
0 commit comments