Skip to content

Commit 8cfd9ae

Browse files
test
1 parent a12485e commit 8cfd9ae

File tree

1 file changed

+96
-2
lines changed

1 file changed

+96
-2
lines changed

.github/workflows/build.yml

Lines changed: 96 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,15 +311,109 @@ jobs:
311311
echo "Failed"
312312
exit 1
313313
fi
314-
315-
316314
- name: Upload build Artifact wheel
317315
uses: actions/upload-artifact@v4
318316
with:
319317
name: wheel-linux-${{ matrix.raylib-platform }}-${{ matrix.python-version }}
320318
path: wheelhouse/*
321319

322320

321+
build-linux32:
322+
runs-on: ubuntu-latest
323+
container:
324+
image: electronstudio/ubuntu16-modern:i386
325+
options: --user root --platform=linux/386
326+
volumes:
327+
# override /__e/node20 because GitHub Actions uses a version that requires too-recent glibc
328+
- /tmp:/__e/node20
329+
strategy:
330+
# You can use PyPy versions in python-version.
331+
# For example, pypy2 and pypy3
332+
matrix:
333+
python-version: ['python3.12', 'python3.13', 'python3.14', 'pypy3.11']
334+
raylib-platform: ['Desktop', 'SDL', 'DRM']
335+
steps:
336+
- name: fix node
337+
run: |
338+
ln -s /usr/local/bin /__e/node20/bin
339+
340+
- uses: actions/checkout@v2
341+
with:
342+
submodules: recursive
343+
344+
- name: fix raygui bug
345+
run: |
346+
patch -p0 <raygui.h.diff
347+
348+
# Runs a set of commands using the runners shell
349+
- name: Build raylib
350+
run: |
351+
cd raylib-c
352+
mkdir build
353+
cd build
354+
setarch i386 cmake -DPLATFORM=${{ matrix.raylib-platform }} -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release -DOpenGL_GL_PREFERENCE=GLVND ..
355+
make -j2
356+
make install
357+
- name: Copy extras
358+
run: |
359+
cp -r raylib-c/src/external/glfw/include/GLFW /usr/local/include/
360+
cp physac/src/physac.h /usr/local/include/
361+
cp raygui/src/raygui.h /usr/local/include/
362+
- name: Build raylib-python-cffi
363+
env:
364+
RAYLIB_PLATFORM: ${{ matrix.raylib-platform }}
365+
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
366+
run: |
367+
${{ matrix.python-version }} -m pip install --upgrade pip
368+
${{ matrix.python-version }} -m pip install --upgrade "cffi>=2.0.0"
369+
${{ matrix.python-version }} -m pip install --upgrade wheel
370+
${{ matrix.python-version }} -m pip install --upgrade setuptools
371+
${{ matrix.python-version }} -m pip install --upgrade build
372+
setarch i386 ${{ matrix.python-version }} -m build --wheel
373+
python3.13 -m pip install --upgrade auditwheel
374+
python3.13 -m pip install --upgrade patchelf
375+
python3.13 -m auditwheel repair dist/*.whl
376+
shell: bash
377+
- name: Rename wheel for testing
378+
run: |
379+
# Rename wheelhouse wheels to be maximally compatible for testing
380+
for wheel in wheelhouse/raylib*.whl; do
381+
if [ -f "$wheel" ]; then
382+
basename=$(basename "$wheel")
383+
# Extract package and version using regex
384+
if [[ $basename =~ ^([^-]+)-([^-]+.*)-[^-]+-[^-]+-[^-]+\.whl$ ]]; then
385+
package="${BASH_REMATCH[1]}"
386+
version="${BASH_REMATCH[2]}"
387+
new_name="${package}-${version}-py3-none-linux_i686.whl"
388+
echo "Renaming: $basename -> $new_name"
389+
cp "$wheel" "wheelhouse/$new_name"
390+
fi
391+
fi
392+
done
393+
shell: bash
394+
- name: Test
395+
run: |
396+
${{ matrix.python-version }} -m pip install --no-deps wheelhouse/*-py3-none-linux_x86_64.whl
397+
# Clean up test wheels
398+
rm -f wheelhouse/*-py3-none-linux_x86_64.whl
399+
cd /
400+
${{ matrix.python-version }} -c 'import pyray; pyray.init_window(100,100,"test")' >/tmp/output 2>&1 || true
401+
cat /tmp/output
402+
if grep -q "INFO: Initializing raylib" /tmp/output; then
403+
echo "Passed"
404+
else
405+
echo "Failed"
406+
exit 1
407+
fi
408+
- name: Upload build Artifact wheel
409+
uses: actions/upload-artifact@v4
410+
with:
411+
name: wheel-linux32-${{ matrix.raylib-platform }}-${{ matrix.python-version }}
412+
path: wheelhouse/*
413+
414+
415+
416+
323417
build-windows:
324418
# The type of runner that the job will run on
325419
runs-on: windows-2022

0 commit comments

Comments
 (0)