Skip to content

Drop Windows-specific script:\"\" hack from SeriousPython.run #48

Drop Windows-specific script:\"\" hack from SeriousPython.run

Drop Windows-specific script:\"\" hack from SeriousPython.run #48

name: Test bridge (no publish, no slow platform tests)
# Throwaway workflow that exercises just the new bridge_example end-to-end
# on Darwin (macOS + iOS) — the platforms ported so far in the dart-bridge
# branch's consolidation work. Other platforms (Linux/Windows/Android) will
# return as each `serious_python_*` plugin gets wired up to download
# pre-built libdart_bridge binaries from flet-dev/dart-bridge releases.
#
# Delete before merging to main.
on:
push:
branches: [dart-bridge]
workflow_dispatch:
env:
SERIOUS_PYTHON_SITE_PACKAGES: "${{ github.workspace }}/site-packages"
jobs:
test_bridge_example_macos:
name: Bridge example macOS round-trip (Python ${{ matrix.python_version }})
# Temporarily gated off while iterating on Windows. Re-enable by removing
# this `if: false`.
if: false
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python_version: ['3.12', '3.13', '3.14']
env:
SERIOUS_PYTHON_VERSION: ${{ matrix.python_version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Flutter
uses: kuhnroyal/flutter-fvm-config-action/setup@v3
with:
path: '.fvmrc'
cache: true
- name: Package + run integration test
working-directory: "src/serious_python/example/bridge_example"
run: |
dart run serious_python:main package app/src --platform Darwin --python-version ${{ matrix.python_version }}
flutter test integration_test -d macos
test_bridge_example_ios:
name: Bridge example iOS round-trip (Python ${{ matrix.python_version }})
if: false # Temporarily gated off while iterating on Windows.
runs-on: macos-latest
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
python_version: ['3.12', '3.13', '3.14']
env:
SERIOUS_PYTHON_VERSION: ${{ matrix.python_version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Flutter
uses: kuhnroyal/flutter-fvm-config-action/setup@v3
with:
path: '.fvmrc'
cache: true
# serious_python_darwin's prepare_ios.sh downloads python-ios-dart-<ver>.tar.gz
# (~100MB) into src/serious_python_darwin/darwin/dist_ios/ and skips the
# download if the directory already exists. Cache it so reruns and
# subsequent matrix jobs don't re-fetch from GitHub Releases.
- name: Cache iOS Python framework
uses: actions/cache@v4
with:
path: src/serious_python_darwin/darwin/dist_ios
key: ios-python-dist-${{ matrix.python_version }}-v2
- name: Setup iOS Simulator
id: simulator
uses: futureware-tech/simulator-action@v4
with:
model: 'iPhone 16 Pro Max'
os: "iOS"
os_version: "^18.6"
shutdown_after_job: true
wait_for_boot: true
- name: Package + run integration test
working-directory: "src/serious_python/example/bridge_example"
run: |
ts() { date '+%H:%M:%S'; }
echo "[$(ts)] >>> dart run serious_python:main package"
# certifi is a placeholder requirement: serious_python_darwin's
# sync_site_packages.sh only populates dist_ios/site-xcframeworks
# (which bundle-python-frameworks-ios.sh then requires at build
# time) when iOS-specific site-packages subdirs exist. Empty
# --requirements skips that branch and the build fails.
dart run serious_python:main package app/src --platform iOS --python-version ${{ matrix.python_version }} --requirements certifi
echo "[$(ts)] >>> flutter test integration_test"
flutter test integration_test --device-id ${{ steps.simulator.outputs.udid }}
echo "[$(ts)] >>> done"
test_bridge_example_android:
name: Bridge example Android round-trip (Python ${{ matrix.python_version }})
if: false # Temporarily gated off while iterating on Windows.
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# x86_64 matches the emulator architecture; only build/install for
# that ABI to keep CI fast.
python_version: ['3.12', '3.13', '3.14']
env:
SERIOUS_PYTHON_VERSION: ${{ matrix.python_version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Flutter
uses: kuhnroyal/flutter-fvm-config-action/setup@v3
with:
path: '.fvmrc'
cache: true
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-bridge
- name: Setup Android Emulator + Run tests
uses: reactivecircus/android-emulator-runner@v2
env:
EMULATOR_PORT: 5554
with:
avd-name: android_emulator
api-level: 33
target: google_atd
arch: x86_64
profile: pixel_5
sdcard-path-or-size: 128M
ram-size: 2048M
disk-size: 4096M
emulator-port: ${{ env.EMULATOR_PORT }}
disable-animations: true
emulator-options: -no-window -noaudio -no-boot-anim -wipe-data -cache-size 1000 -partition-size 8192
pre-emulator-launch-script: |
sdkmanager --list_installed
script: |
cd src/serious_python/example/bridge_example && dart run serious_python:main package app/src --platform Android --python-version ${{ matrix.python_version }}
cd src/serious_python/example/bridge_example && flutter test integration_test --device-id emulator-${{ env.EMULATOR_PORT }}
- name: Diagnostics on failure
if: failure()
shell: bash
run: |
set +e
REPO="$GITHUB_WORKSPACE"
ABI=x86_64
echo "=== serious_python_android/android/src/main/jniLibs/$ABI/ ==="
ls -la "$REPO/src/serious_python_android/android/src/main/jniLibs/$ABI/" 2>/dev/null || echo "(not found)"
echo
echo "=== example/build/app/outputs/apk/debug/*.apk ==="
APK=$(find "$REPO/src/serious_python/example/bridge_example/build" -name "*-debug.apk" 2>/dev/null | head -n1)
echo "APK: $APK"
if [ -n "$APK" ]; then
echo "Native libs inside APK:"
unzip -l "$APK" | grep -E "lib/$ABI/" || echo "(no lib/$ABI/ entries)"
fi
test_bridge_example_windows:
name: Bridge example Windows round-trip (Python ${{ matrix.python_version }})
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python_version: ['3.12', '3.13', '3.14']
env:
SERIOUS_PYTHON_VERSION: ${{ matrix.python_version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Flutter
uses: kuhnroyal/flutter-fvm-config-action/setup@v3
with:
path: '.fvmrc'
cache: true
- name: Package + run integration test
working-directory: "src/serious_python/example/bridge_example"
shell: bash
run: |
dart run serious_python:main package app/src --platform Windows --python-version ${{ matrix.python_version }}
# bash + pipefail so the test step actually fails when flutter fails
# (default PowerShell shell on windows runners eats the failure when
# piping into tail).
set -o pipefail
flutter test integration_test -d windows -v 2>&1 | tail -300
- name: Diagnostics on failure
if: failure()
shell: bash
working-directory: "src/serious_python/example/bridge_example"
run: |
set +e
DBG_DIR=build/windows/x64/runner/Debug
echo "=== runner/Debug dir ==="
ls -la $DBG_DIR/ || true
echo
echo "=== dart_bridge*.dll bundled? ==="
ls -la $DBG_DIR/dart_bridge*.dll || echo "(no dart_bridge dll bundled)"
echo
echo "=== runner/Debug/Lib (Python stdlib) ==="
ls $DBG_DIR/Lib | head -20 || true
echo
echo "=== runner/Debug/site-packages ==="
ls -la $DBG_DIR/site-packages/ || true