-
-
Notifications
You must be signed in to change notification settings - Fork 43
80 lines (74 loc) · 2.65 KB
/
test_pypi.yml
File metadata and controls
80 lines (74 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Test PyPI Install
# Controls when the workflow will run
on:
# Allows you to run this workflow manually from the Actions tab only
workflow_dispatch:
inputs:
package_name:
description: "Package to install from PyPI (raylib, raylib_sdl, raylib_drm, raylib_dynamic)"
type: string
required: true
default: "raylib"
version:
description: "Package version to install (e.g., 5.5.0.2, or leave empty for latest)"
type: string
required: false
default: ""
pre_release:
description: "Allow pre-release versions?"
type: boolean
required: false
default: false
jobs:
test-pypi-install:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-15-intel, macos-14, macos-26]
python-version: ["3.14", "3.13"]
python-source: [homebrew, python-org]
steps:
- name: Install Python from Homebrew
if: matrix.python-source == 'homebrew'
run: |
brew install python@${{ matrix.python-version }}
PYTHON_BIN="$(brew --prefix python@${{ matrix.python-version }})/bin/python${{ matrix.python-version }}"
echo "PYTHON_BIN=$PYTHON_BIN" >> "$GITHUB_ENV"
$PYTHON_BIN --version
- name: Setup Python (python.org)
if: matrix.python-source == 'python-org'
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set Python bin (python.org)
if: matrix.python-source == 'python-org'
shell: bash
run: |
PYTHON_BIN="$(command -v python${{ matrix.python-version }} || command -v python3)"
echo "PYTHON_BIN=$PYTHON_BIN" >> "$GITHUB_ENV"
$PYTHON_BIN --version
- name: Install package from PyPI
run: |
PRE_FLAG=""
if [ "${{ inputs.pre_release }}" = "true" ]; then
PRE_FLAG="--pre"
fi
if [ -n "${{ inputs.version }}" ]; then
"$PYTHON_BIN" -m pip install $PRE_FLAG "${{ inputs.package_name }}==${{ inputs.version }}" --break-system-packages
else
"$PYTHON_BIN" -m pip install $PRE_FLAG "${{ inputs.package_name }}" --break-system-packages
fi
- name: Test import and basic initialization
run: |
cd /
"$PYTHON_BIN" -c 'import pyray; pyray.init_window(100,100,"test")' >/tmp/output 2>&1 || true
cat /tmp/output
if grep -q "INFO: Initializing raylib" /tmp/output; then
echo "Passed"
exit 0
else
echo "Failed"
exit 1
fi
shell: bash