Skip to content

Commit 766924b

Browse files
Create test_pypi.yml
1 parent 5fa3764 commit 766924b

1 file changed

Lines changed: 65 additions & 0 deletions

File tree

.github/workflows/test_pypi.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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+
"$PYTHON_BIN" -m pip install --upgrade pip
43+
PRE_FLAG=""
44+
if [ "${{ inputs.pre_release }}" = "true" ]; then
45+
PRE_FLAG="--pre"
46+
fi
47+
if [ -n "${{ inputs.version }}" ]; then
48+
"$PYTHON_BIN" -m pip install $PRE_FLAG "${{ inputs.package_name }}==${{ inputs.version }}" --break-system-packages
49+
else
50+
"$PYTHON_BIN" -m pip install $PRE_FLAG "${{ inputs.package_name }}" --break-system-packages
51+
fi
52+
53+
- name: Test import and basic initialization
54+
run: |
55+
cd /
56+
"$PYTHON_BIN" -c 'import pyray; pyray.init_window(100,100,"test")' >/tmp/output 2>&1 || true
57+
cat /tmp/output
58+
if grep -q "INFO: Initializing raylib" /tmp/output; then
59+
echo "Passed"
60+
exit 0
61+
else
62+
echo "Failed"
63+
exit 1
64+
fi
65+
shell: bash

0 commit comments

Comments
 (0)