Skip to content

Commit c6d3544

Browse files
committed
[GR-72642] Add Cython to downstream tests
PullRequest: graalpython/4199
2 parents 7e840d5 + ea56c7d commit c6d3544

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.github/workflows/downstream-tests.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,16 @@ on:
55
workflow_dispatch:
66

77
jobs:
8+
9+
build-standalone-artifacts:
10+
uses: ./.github/workflows/ci-matrix-gen.yml
11+
with:
12+
jobs_to_run: ^(?=.*python-svm-build-gate-linux-amd64).*$
13+
logs_retention_days: 0
14+
artifacts_retention_days: 0
15+
816
downstream-tests:
17+
needs: build-standalone-artifacts
918
strategy:
1019
fail-fast: false
1120
matrix:
@@ -15,6 +24,7 @@ jobs:
1524
- pyo3
1625
- pydantic-core
1726
- jiter
27+
- cython
1828
os:
1929
- id: ubuntu-latest
2030
platform: linux
@@ -24,6 +34,9 @@ jobs:
2434
arch: aarch64
2535

2636
runs-on: ${{ matrix.os.id }}
37+
env:
38+
ARTIFACT_PATH: graalpy-native-standalone{{ matrix.os.platform }}
39+
ARTIFACT_PATH_PREFIX: graalpynative
2740

2841
steps:
2942
- name: Install CMake (Linux)
@@ -57,9 +70,23 @@ jobs:
5770
uses: actions/checkout@v4
5871

5972
- name: Get GraalPy EA build
73+
if: ${{ matrix.os.platform == 'darwin' }}
6074
run: |
6175
tarball="$(curl -s "https://api.github.com/repos/graalvm/graalvm-ce-dev-builds/releases/latest" | jq -r --arg artifact "graalpy-community-dev-${{ matrix.os.platform }}-${{matrix.os.arch}}.tar.gz" '.assets[] | select(.name == $artifact) | .browser_download_url')"
6276
curl -sfL "$tarball" | tar xz
6377
78+
- name: Get GraalPy build artifact
79+
if: ${{ matrix.os.platform == 'linux' }}
80+
uses: actions/download-artifact@v5
81+
with:
82+
name: graalpy-native-standalonelinux
83+
path: ${{ env.ARTIFACT_PATH_PREFIX }}
84+
85+
- name: Unpack GraalPy build artifact
86+
if: ${{ matrix.os.platform == 'linux' }}
87+
run: |
88+
./.github/scripts/unpack-artifact graalpy-native-standalonelinux
89+
mv $ARTIFACT_PATH_PREFIX/main/mxbuild/linux-amd64/GRAALPY_NATIVE_STANDALONE/ graalpy-native-standalone
90+
6491
- name: Run downstream tests for ${{ matrix.name }}
6592
run: python mx.graalpython/downstream_tests.py graalpy-*/bin/python ${{ matrix.name }}

mx.graalpython/downstream_tests.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,16 @@ def downstream_test_jiter(graalpy, testdir):
173173
run_in_venv(venv, ['pytest', '-v', '--tb=short', 'crates/jiter-python/tests'], cwd=src)
174174
run_in_venv(venv, ['python', 'crates/jiter-python/bench.py', 'jiter', 'jiter-cache', '--fast'], cwd=src)
175175

176+
@downstream_test('cython')
177+
def downstream_test_cython(graalpy, testdir):
178+
run(['git', 'clone', 'https://github.com/cython/cython.git', '-b', 'master'], cwd=testdir)
179+
src = testdir / 'cython'
180+
venv = src / 'venv'
181+
env = os.environ.copy()
182+
env["PYTHON_VERSION"] = "graalpy"
183+
env["BACKEND"] = "c"
184+
run([graalpy, '-m', 'venv', str(venv)])
185+
run_in_venv(venv, ["bash", "./Tools/ci-run.sh"], cwd=src, env=env)
176186

177187
def run_downstream_test(python, project):
178188
testdir = Path('downstream-tests').absolute()

0 commit comments

Comments
 (0)