Skip to content

Commit 9a736fe

Browse files
committed
Add riscv64 wheel build for gseapy
1 parent 5ee5fc8 commit 9a736fe

2 files changed

Lines changed: 121 additions & 0 deletions

File tree

‎.github/workflows/build-gseapy.yml‎

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# SPDX-FileCopyrightText: 2026 The RISE Project
2+
# SPDX-License-Identifier: MIT
3+
---
4+
# Based on upstream's own wheel and test workflows:
5+
# https://github.com/zqfang/GSEApy/blob/v1.3.1/.github/workflows/wheels.yml
6+
# https://github.com/zqfang/GSEApy/blob/v1.3.1/.github/workflows/test.yml
7+
name: Build gseapy wheels (riscv64)
8+
9+
on:
10+
workflow_dispatch:
11+
inputs:
12+
version:
13+
description: 'Version glob to (re)build; empty builds every version of docs/packages/gseapy.yaml not released yet'
14+
required: false
15+
default: ''
16+
pull_request:
17+
branches: [main]
18+
paths:
19+
- '.github/workflows/build-gseapy.yml'
20+
- 'docs/packages/gseapy.yaml'
21+
push:
22+
branches: [main]
23+
paths:
24+
- '.github/workflows/build-gseapy.yml'
25+
- 'docs/packages/gseapy.yaml'
26+
27+
concurrency:
28+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
29+
cancel-in-progress: true
30+
31+
permissions:
32+
contents: read # to fetch code (actions/checkout)
33+
34+
env:
35+
MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64
36+
37+
jobs:
38+
setup:
39+
uses: $/.github/workflows/_setup.yml
40+
with:
41+
package: gseapy
42+
version: ${{ inputs.version }}
43+
44+
build_wheels:
45+
needs: [setup]
46+
if: needs.setup.outputs.versions != '[]'
47+
name: Build gseapy ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64
48+
runs-on: ubuntu-24.04-riscv
49+
timeout-minutes: 120
50+
strategy:
51+
fail-fast: false
52+
matrix:
53+
version: ${{ fromJSON(needs.setup.outputs.versions) }}
54+
python: ["cp312", "cp313", "cp314", "cp314t"]
55+
include:
56+
# pandas, a hard runtime dependency, has no cp314t riscv64 wheel on pypi.riseproject.dev.
57+
- python: "cp314t"
58+
test_skip: "*"
59+
60+
env:
61+
GSEAPY_VERSION: ${{ matrix.version }}
62+
63+
steps:
64+
- name: Checkout gseapy v${{ env.GSEAPY_VERSION }}
65+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
66+
with:
67+
repository: zqfang/GSEApy
68+
ref: v${{ env.GSEAPY_VERSION }}
69+
persist-credentials: false
70+
71+
- name: Build wheels
72+
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
73+
with:
74+
output-dir: wheelhouse/
75+
only: ${{ matrix.python }}-manylinux_riscv64
76+
env:
77+
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
78+
CIBW_BEFORE_ALL_LINUX: >-
79+
yum install libatomic -y &&
80+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
81+
CIBW_ENVIRONMENT_LINUX: >-
82+
PATH="$PATH:$HOME/.cargo/bin"
83+
PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/
84+
PIP_ONLY_BINARY=numpy,scipy,pandas,matplotlib,contourpy,kiwisolver,pillow,fonttools,lxml,pyyaml
85+
CIBW_BEFORE_BUILD: >-
86+
python -m pip install -U pip setuptools wheel build setuptools-rust
87+
CIBW_TEST_EXTRAS: test
88+
CIBW_TEST_SOURCES: tests pyproject.toml
89+
CIBW_TEST_COMMAND: pytest tests
90+
CIBW_TEST_SKIP: ${{ matrix.test_skip }}
91+
92+
- name: Check the Rust extension is in the wheel
93+
run: python3 -m zipfile -l wheelhouse/*.whl | grep -E 'gseapy/gse\..*\.so'
94+
95+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
96+
with:
97+
name: gseapy-${{ env.GSEAPY_VERSION }}-${{ matrix.python }}-manylinux_riscv64
98+
path: wheelhouse/*.whl
99+
if-no-files-found: error
100+
101+
publish:
102+
name: Publish gseapy ${{ matrix.version }}
103+
needs: [setup, build_wheels]
104+
if: needs.setup.outputs.versions != '[]'
105+
strategy:
106+
fail-fast: false
107+
matrix:
108+
version: ${{ fromJSON(needs.setup.outputs.versions) }}
109+
permissions:
110+
contents: write
111+
pull-requests: write
112+
uses: $/.github/workflows/_publish-wheel.yml
113+
secrets:
114+
app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }}
115+
with:
116+
artifact-pattern: gseapy-${{ matrix.version }}-*-manylinux_riscv64

‎docs/packages/gseapy.yaml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package-name: gseapy
2+
source-code: https://github.com/zqfang/GSEApy
3+
license: BSD-3-Clause
4+
versions:
5+
- version: 1.3.1

0 commit comments

Comments
 (0)