Skip to content

Commit 66ccbf0

Browse files
committed
Attempting to add testing for RiscV64
1 parent b9e93f1 commit 66ccbf0

File tree

2 files changed

+70
-1
lines changed

2 files changed

+70
-1
lines changed

.github/workflows/tests.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,27 @@ jobs:
145145
- name: Perform CodeQL Analysis
146146
uses: github/codeql-action/analyze@v3
147147

148-
manylinux:
148+
riscv64:
149+
runs-on: ubuntu-latest
150+
name: RiscV 64
151+
steps:
152+
- name: checkout
153+
uses: actions/checkout@v4
154+
- name: Set up Python
155+
uses: actions/setup-python@v5
156+
with:
157+
python-version: "3.13"
158+
- name: Set up QEMU
159+
uses: docker/setup-qemu-action@v3
160+
with:
161+
platforms: all
162+
- name: Build and test greenlet
163+
env:
164+
DOCKER_IMAGE: riscv64/ubuntu:latest
165+
run: bash ./ubuntu-test
149166

167+
168+
manylinux:
150169
runs-on: ubuntu-latest
151170
# We use a regular Python matrix entry to share as much code as possible.
152171
strategy:

ubuntu-test

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
3+
# This needs to be run from the root of the project.
4+
# To update: docker pull quay.io/pypa/manylinux2010_x86_64
5+
set -e
6+
export PYTHONUNBUFFERED=1
7+
export PYTHONDONTWRITEBYTECODE=1
8+
# Use a fixed hash seed for reproducibility
9+
export PYTHONHASHSEED=8675309
10+
export CI=1
11+
export TRAVIS=true
12+
export PIP_NO_WARN_SCRIPT_LOCATION=1
13+
14+
15+
if [ -d /greenlet ]; then
16+
# Running inside docker
17+
export GREENLET_MANYLINUX=1
18+
# Build for speed (we're going to test this anyway) and without assertions.
19+
# Note: -Ofast includes -ffast-math which affects process-wide floating-point flags (e.g. can affect numpy).
20+
# It may also violate standards compliance in a few ways. Rather than opt-out with -fno-fast-math,
21+
# we use O3, which has neither of those problems.
22+
export CFLAGS="-O3 -DNDEBUG -Wall"
23+
24+
apt-get update
25+
apt-get install -y python3.12 python3.12-dev python3.12-venv gcc git g++
26+
update-alternatives --install /usr/bin/python python /usr/bin/python3.12 1
27+
28+
# Build in an isolated directory
29+
mkdir /tmp/build
30+
cd /tmp/build
31+
git config --global --add safe.directory /greenlet/.git
32+
git clone /greenlet greenlet
33+
cd greenlet
34+
35+
python -m venv /tmp/venv
36+
. /tmp/venv/bin/activate
37+
echo "Python"
38+
python --version
39+
40+
python -mpip install -U pip
41+
python -mpip install -U setuptools wheel
42+
python -mpip wheel -v --wheel-dir ./dist .
43+
python -mpip install -U .[test]
44+
python -m unittest discover -v greenlet.tests
45+
46+
exit 0
47+
fi
48+
49+
# Mount the current directory as /greenlet
50+
docker run --rm -v "$(pwd):/greenlet" ${DOCKER_IMAGE:-riscv64/ubuntu:latest} /greenlet/$(basename $0)

0 commit comments

Comments
 (0)