Skip to content

Commit 25505fa

Browse files
Create test_pypi.yml
1 parent 5fa3764 commit 25505fa

1 file changed

Lines changed: 64 additions & 0 deletions

File tree

.github/workflows/test_pypi.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Test PyPI Install
2+
3+
# Controls when the workflow will run
4+
on:
5+
# Allows you to run this workflow manually from the Actions tab only
6+
workflow_dispatch:
7+
inputs:
8+
package_name:
9+
description: "Package to install from PyPI (raylib, raylib_sdl, raylib_drm, raylib_dynamic)"
10+
type: string
11+
required: true
12+
default: "raylib"
13+
version:
14+
description: "Package version to install (e.g., 5.5.0.2, or leave empty for latest)"
15+
type: string
16+
required: false
17+
default: ""
18+
pre_release:
19+
description: "Allow pre-release versions?"
20+
type: boolean
21+
required: false
22+
default: false
23+
24+
jobs:
25+
test-pypi-install:
26+
runs-on: ${{ matrix.os }}
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
os: [macos-15-intel, macos-14, macos-26]
31+
python-version: ["3.14", "3.12", "3.13"]
32+
steps:
33+
- name: Install Python from Homebrew
34+
run: |
35+
brew install python@${{ matrix.python-version }}
36+
PYTHON_BIN="$(brew --prefix python@${{ matrix.python-version }})/bin/python${{ matrix.python-version }}"
37+
echo "PYTHON_BIN=$PYTHON_BIN" >> "$GITHUB_ENV"
38+
$PYTHON_BIN --version
39+
40+
- name: Install package from PyPI
41+
run: |
42+
PRE_FLAG=""
43+
if [ "${{ inputs.pre_release }}" = "true" ]; then
44+
PRE_FLAG="--pre"
45+
fi
46+
if [ -n "${{ inputs.version }}" ]; then
47+
"$PYTHON_BIN" -m pip install $PRE_FLAG "${{ inputs.package_name }}==${{ inputs.version }}" --break-system-packages
48+
else
49+
"$PYTHON_BIN" -m pip install $PRE_FLAG "${{ inputs.package_name }}" --break-system-packages
50+
fi
51+
52+
- name: Test import and basic initialization
53+
run: |
54+
cd /
55+
"$PYTHON_BIN" -c 'import pyray; pyray.init_window(100,100,"test")' >/tmp/output 2>&1 || true
56+
cat /tmp/output
57+
if grep -q "INFO: Initializing raylib" /tmp/output; then
58+
echo "Passed"
59+
exit 0
60+
else
61+
echo "Failed"
62+
exit 1
63+
fi
64+
shell: bash

0 commit comments

Comments
 (0)