Skip to content

Commit 48bcc23

Browse files
Create test_pypi.yml
1 parent 5fa3764 commit 48bcc23

1 file changed

Lines changed: 80 additions & 0 deletions

File tree

.github/workflows/test_pypi.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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.13"]
32+
python-source: [homebrew, python-org]
33+
steps:
34+
- name: Install Python from Homebrew
35+
if: matrix.python-source == 'homebrew'
36+
run: |
37+
brew install python@${{ matrix.python-version }}
38+
PYTHON_BIN="$(brew --prefix python@${{ matrix.python-version }})/bin/python${{ matrix.python-version }}"
39+
echo "PYTHON_BIN=$PYTHON_BIN" >> "$GITHUB_ENV"
40+
$PYTHON_BIN --version
41+
42+
- name: Setup Python (python.org)
43+
if: matrix.python-source == 'python-org'
44+
uses: actions/setup-python@v5
45+
with:
46+
python-version: ${{ matrix.python-version }}
47+
48+
- name: Set Python bin (python.org)
49+
if: matrix.python-source == 'python-org'
50+
shell: bash
51+
run: |
52+
PYTHON_BIN="$(command -v python${{ matrix.python-version }} || command -v python3)"
53+
echo "PYTHON_BIN=$PYTHON_BIN" >> "$GITHUB_ENV"
54+
$PYTHON_BIN --version
55+
56+
- name: Install package from PyPI
57+
run: |
58+
PRE_FLAG=""
59+
if [ "${{ inputs.pre_release }}" = "true" ]; then
60+
PRE_FLAG="--pre"
61+
fi
62+
if [ -n "${{ inputs.version }}" ]; then
63+
"$PYTHON_BIN" -m pip install $PRE_FLAG "${{ inputs.package_name }}==${{ inputs.version }}" --break-system-packages
64+
else
65+
"$PYTHON_BIN" -m pip install $PRE_FLAG "${{ inputs.package_name }}" --break-system-packages
66+
fi
67+
68+
- name: Test import and basic initialization
69+
run: |
70+
cd /
71+
"$PYTHON_BIN" -c 'import pyray; pyray.init_window(100,100,"test")' >/tmp/output 2>&1 || true
72+
cat /tmp/output
73+
if grep -q "INFO: Initializing raylib" /tmp/output; then
74+
echo "Passed"
75+
exit 0
76+
else
77+
echo "Failed"
78+
exit 1
79+
fi
80+
shell: bash

0 commit comments

Comments
 (0)