From d431a5d01309b69e051ea53d3c7729aaa954833c Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Wed, 15 Oct 2025 13:46:20 +0200 Subject: [PATCH 01/49] initial commit --- .fvmrc | 3 ++ .github/scripts/download_artifact.py | 51 ++++++++++++++++++++++++++++ .github/scripts/patch_pubspec.py | 37 ++++++++++++++++++++ .github/workflows/ci.yml | 19 +++++++++++ 4 files changed, 110 insertions(+) create mode 100644 .fvmrc create mode 100644 .github/scripts/download_artifact.py create mode 100644 .github/scripts/patch_pubspec.py create mode 100644 .github/workflows/ci.yml diff --git a/.fvmrc b/.fvmrc new file mode 100644 index 00000000..69d6f3cd --- /dev/null +++ b/.fvmrc @@ -0,0 +1,3 @@ +{ + "flutter": "3.27.4" +} diff --git a/.github/scripts/download_artifact.py b/.github/scripts/download_artifact.py new file mode 100644 index 00000000..6b37f5d7 --- /dev/null +++ b/.github/scripts/download_artifact.py @@ -0,0 +1,51 @@ +import json +import os +import pathlib +import sys +import tarfile +import urllib.request + +if len(sys.argv) < 2: + print("Specify artifact job name and artifact deployment name to download") + sys.exit(1) + +artifact_job_name = sys.argv[1] +artifact_file_name = sys.argv[2].format( + version=os.environ.get("APPVEYOR_BUILD_VERSION") +) + +build_jobs = {} + + +def download_job_artifact(job_id, file_name, dest_file): + url = f"https://ci.appveyor.com/api/buildjobs/{job_id}/artifacts/{file_name}" + print(f"Downloading {url}...") + urllib.request.urlretrieve(url, dest_file) + + +def get_build_job_ids(): + account_name = os.environ.get("APPVEYOR_ACCOUNT_NAME") + project_slug = os.environ.get("APPVEYOR_PROJECT_SLUG") + build_id = os.environ.get("APPVEYOR_BUILD_ID") + url = f"https://ci.appveyor.com/api/projects/{account_name}/{project_slug}/builds/{build_id}" + print(f"Fetching build details at {url}") + req = urllib.request.Request(url) + req.add_header("Content-type", "application/json") + project = json.loads(urllib.request.urlopen(req).read().decode()) + for job in project["build"]["jobs"]: + build_jobs[job["name"]] = job["jobId"] + + +current_dir = pathlib.Path(os.getcwd()) +print("current_dir", current_dir) + +get_build_job_ids() + +# create "web" directory +dist_path = current_dir.joinpath("python_dist") +dist_path.mkdir(exist_ok=True) +tar_path = current_dir.joinpath(artifact_file_name) +download_job_artifact(build_jobs[artifact_job_name], artifact_file_name, tar_path) +with tarfile.open(tar_path, "r:gz") as tar: + tar.extractall(str(dist_path)) +os.remove(tar_path) diff --git a/.github/scripts/patch_pubspec.py b/.github/scripts/patch_pubspec.py new file mode 100644 index 00000000..d655767a --- /dev/null +++ b/.github/scripts/patch_pubspec.py @@ -0,0 +1,37 @@ +import os +import pathlib +import sys + +import yaml + +if len(sys.argv) < 3: + print("Specify pubspec.yaml file and version to patch") + sys.exit(1) + +current_dir = pathlib.Path(os.getcwd()) +pubspec_path = current_dir.joinpath(current_dir, sys.argv[1]) +ver = sys.argv[2] +print(f"Patching pubspec.yaml file {pubspec_path} with {ver}") + +dependencies = [ + "serious_python_platform_interface", + "serious_python_android", + "serious_python_darwin", + "serious_python_windows", + "serious_python_linux", + "serious_python_macos", +] + +with open(pubspec_path, "r") as f: + data = yaml.safe_load(f) + + # patch version + data["version"] = ver + + # patch dependencies + for dep in data["dependencies"]: + if dep in dependencies: + data["dependencies"][dep] = f"^{ver}" + # print(dep) +with open(pubspec_path, "w") as file: + yaml.dump(data, file, sort_keys=False) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..0f78674b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,19 @@ +name: CI + +on: + push: + branches: + - '**' + tags: + - '*' + pull_request: + workflow_dispatch: + +permissions: + contents: write + +env: + ROOT: "${{ github.workspace }}" + SCRIPTS: "${{ github.workspace }}/.github/scripts" + UV_PYTHON: "3.12" + PYODIDE_VERSION: "0.27.7" \ No newline at end of file From 9a149ac387603fcd5f411ef901af819d604a28eb Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Sat, 18 Oct 2025 16:12:28 +0200 Subject: [PATCH 02/49] updates --- .github/scripts/patch_pubspec.py | 6 +- .github/workflows/ci.yml | 225 ++++++++++++++++++++++++++++++- 2 files changed, 229 insertions(+), 2 deletions(-) diff --git a/.github/scripts/patch_pubspec.py b/.github/scripts/patch_pubspec.py index d655767a..66689a46 100644 --- a/.github/scripts/patch_pubspec.py +++ b/.github/scripts/patch_pubspec.py @@ -1,3 +1,7 @@ +# /// script +# dependencies = ["pyyaml"] +# /// + import os import pathlib import sys @@ -22,7 +26,7 @@ "serious_python_macos", ] -with open(pubspec_path, "r") as f: +with open(pubspec_path) as f: data = yaml.safe_load(f) # patch version diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f78674b..fe03b9cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,5 +15,228 @@ permissions: env: ROOT: "${{ github.workspace }}" SCRIPTS: "${{ github.workspace }}/.github/scripts" + SERIOUS_PYTHON_SITE_PACKAGES: "${{ github.workspace }}/site-packages" UV_PYTHON: "3.12" - PYODIDE_VERSION: "0.27.7" \ No newline at end of file + +jobs: + macos: + name: Test on macOS + runs-on: macos-14 + 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: Run tests + shell: bash + run: | + export SERIOUS_PYTHON_SITE_PACKAGES=$GITHUB_WORKSPACE/site-packages + cd src/serious_python/example/flet_example + dart run serious_python:main package app/src -p Darwin -r flet -r --pre + flutter test integration_test -d macos + + ios: + name: Test on iOS + runs-on: macos-14 + 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: Build iOS (no codesign) + shell: bash + run: | + export SERIOUS_PYTHON_SITE_PACKAGES=$GITHUB_WORKSPACE/site-packages + cd src/serious_python/example/flet_example + dart run serious_python:main package app/src -p iOS -r flet -r --pre + flutter build ios --no-codesign + # add simulator drive steps later if needed + + android: + name: Test on Android + runs-on: ubuntu-22.04 + 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: Accept SDK licenses + shell: bash + run: | + sudo apt-get update + sudo apt-get install -y unzip + echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --licenses || true + - name: Prepare Android emulator + Flutter + shell: bash + env: + API_LEVEL: "33" + TARGET: "google_atd" + ARCH: "x86_64" + DEVICE_NAME: "android_emulator" + DEVICE_TYPE: "pixel_5" + run: | + export PATH=$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$PATH + sdkmanager "platform-tools" "platforms;android-${API_LEVEL}" + sdkmanager --install "system-images;android-${API_LEVEL};${TARGET};${ARCH}" + sdkmanager --update + echo "no" | avdmanager -v create avd --force --name "${DEVICE_NAME}" --package "system-images;android-${API_LEVEL};${TARGET};${ARCH}" --tag "${TARGET}" --sdcard 128M --device "${DEVICE_TYPE}" + ${ANDROID_HOME}/emulator/emulator -avd "${DEVICE_NAME}" -memory 2048 -wipe-data -no-boot-anim -noaudio -no-window -accel off -partition-size 8192 & + adb wait-for-device shell 'while [[ -z $(getprop dev.bootcomplete) ]]; do sleep 1; done;' + + - name: Run tests + shell: bash + run: | + cd src/serious_python/example/flet_example + dart run serious_python:main package app/src -p Android -r flet -r --pre + flutter test integration_test -d emulator-5554 + + windows: + name: Test on Windows + runs-on: windows-latest + 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: Run tests + shell: pwsh + run: | + cd src/serious_python/example/flet_example + dart run serious_python:main package app/src -p Windows -r flet -r --pre + flutter test integration_test -d windows + + linux: + name: Test on Linux + runs-on: ubuntu-22.04 + 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: Install desktop deps + run: | + sudo apt-get update --allow-releaseinfo-change + sudo apt-get install -y xvfb libgtk-3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio + + - name: Run tests + shell: bash + run: | + cd src/serious_python/example/flet_example + dart run serious_python:main package app/src -p Linux -r flet -r --pre + xvfb-run flutter test integration_test -d linux + + linux-arm64: + name: Test on Linux ARM64 + runs-on: ubuntu-22.04-arm64 # change if you use self-hosted ARM64 + 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: Install deps + shell: bash + run: | + sudo sed -i "/#\$nrconf{restart} = 'i';/s/.*/\$nrconf{restart} = 'a';/" /etc/needrestart/needrestart.conf + sudo apt-get update -y --allow-releaseinfo-change + sudo apt-get install -y clang ninja-build xvfb libgtk-3-dev gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav + + - name: Run tests + shell: bash + run: | + cd src/serious_python/example/flet_example + dart run serious_python:main package app/src -p Linux -r flet -r --pre + xvfb-run flutter test integration_test -d linux + + publish: + name: Publish to pub.dev + needs: + - macos + - ios + - android + - windows + - linux + - linux-arm64 + runs-on: ubuntu-22.04 + # if: startsWith(github.ref, 'refs/tags/v') + steps: + + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Flutter + uses: kuhnroyal/flutter-fvm-config-action/setup@v3 + with: + path: '.fvmrc' + cache: true + + - name: Compute PKG_VER + id: ver + shell: bash + run: | + PKG_VER="${GITHUB_REF_NAME#v}" + echo "PKG_VER=$PKG_VER" | tee -a "$GITHUB_ENV" + sudo apt-get update + + - name: Configure pub.dev credentials + # if: ${{ secrets.PUB_DEV_TOKEN != '' }} + env: + PUB_DEV_TOKEN: ${{ secrets.PUB_DEV_TOKEN }} + run: | + mkdir -p $HOME/.config/dart + echo "$PUB_DEV_TOKEN" | base64 --decode > $HOME/.config/dart/pub-credentials.json + + - name: Patch pubspec versions + run: | + uv run "$SCRIPTS/patch_pubspec.py" "src/serious_python_platform_interface/pubspec.yaml" "$PKG_VER" + uv run "$SCRIPTS/patch_pubspec.py" "src/serious_python/pubspec.yaml" "$PKG_VER" + uv run "$SCRIPTS/patch_pubspec.py" "src/serious_python_android/pubspec.yaml" "$PKG_VER" + uv run "$SCRIPTS/patch_pubspec.py" "src/serious_python_darwin/pubspec.yaml" "$PKG_VER" + uv run "$SCRIPTS/patch_pubspec.py" "src/serious_python_windows/pubspec.yaml" "$PKG_VER" + uv run "$SCRIPTS/patch_pubspec.py" "src/serious_python_linux/pubspec.yaml" "$PKG_VER" + + - name: Publish packages + shell: bash + if: false + run: | + publish_pkg () { pushd "$1" >/dev/null; dart pub publish --force; popd >/dev/null; } + + publish_pkg src/serious_python_platform_interface + sleep 600 + publish_pkg src/serious_python_android + publish_pkg src/serious_python_darwin + publish_pkg src/serious_python_windows + publish_pkg src/serious_python_linux + sleep 600 + publish_pkg src/serious_python \ No newline at end of file From 845c0a5672c07f90f272694427c8f298b1477d57 Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Sat, 18 Oct 2025 16:23:10 +0200 Subject: [PATCH 03/49] updates --- .github/workflows/ci.yml | 43 +++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe03b9cc..2b04ed06 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ env: jobs: macos: name: Test on macOS - runs-on: macos-14 + runs-on: macos-latest steps: - name: Checkout repository uses: actions/checkout@v4 @@ -42,7 +42,7 @@ jobs: ios: name: Test on iOS - runs-on: macos-14 + runs-on: macos-latest steps: - name: Checkout repository uses: actions/checkout@v4 @@ -75,20 +75,32 @@ jobs: path: '.fvmrc' cache: true + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: Setup Android SDK + uses: android-actions/setup-android@v3 + with: + packages: 'tools platform-tools' + - name: Accept SDK licenses shell: bash run: | sudo apt-get update sudo apt-get install -y unzip echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --licenses || true - - name: Prepare Android emulator + Flutter - shell: bash + + - name: Prepare Android emulator env: API_LEVEL: "33" TARGET: "google_atd" ARCH: "x86_64" DEVICE_NAME: "android_emulator" DEVICE_TYPE: "pixel_5" + shell: bash run: | export PATH=$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$PATH sdkmanager "platform-tools" "platforms;android-${API_LEVEL}" @@ -127,7 +139,7 @@ jobs: linux: name: Test on Linux - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout repository uses: actions/checkout@v4 @@ -141,7 +153,24 @@ jobs: - name: Install desktop deps run: | sudo apt-get update --allow-releaseinfo-change - sudo apt-get install -y xvfb libgtk-3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio + sudo apt-get install -y \ + xvfb \ + libgtk-3-dev \ + libgstreamer1.0-dev \ + libgstreamer-plugins-base1.0-dev \ + libgstreamer-plugins-bad1.0-dev \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad \ + gstreamer1.0-plugins-ugly \ + gstreamer1.0-libav \ + gstreamer1.0-tools \ + gstreamer1.0-x \ + gstreamer1.0-alsa \ + gstreamer1.0-gl \ + gstreamer1.0-gtk3 \ + gstreamer1.0-qt5 \ + gstreamer1.0-pulseaudio - name: Run tests shell: bash @@ -152,7 +181,7 @@ jobs: linux-arm64: name: Test on Linux ARM64 - runs-on: ubuntu-22.04-arm64 # change if you use self-hosted ARM64 + runs-on: ubuntu-24.04-arm steps: - name: Checkout repository uses: actions/checkout@v4 From 3dba2b5efc002b4d26cbd29d8e8bf9b7d564bd1b Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Sat, 18 Oct 2025 17:05:23 +0200 Subject: [PATCH 04/49] chore(ci): update CI configuration for concurrency and Flutter setup --- .github/workflows/ci.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b04ed06..ce2cc774 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,10 @@ on: permissions: contents: write +concurrency: + group: ci-${{ github.workflow }}-${{ github.event.pull_request.head.ref || github.ref_name }} + cancel-in-progress: true + env: ROOT: "${{ github.workspace }}" SCRIPTS: "${{ github.workspace }}/.github/scripts" @@ -64,7 +68,7 @@ jobs: android: name: Test on Android - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout repository uses: actions/checkout@v4 @@ -186,10 +190,17 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Setup Flutter - uses: kuhnroyal/flutter-fvm-config-action/setup@v3 + - name: Get Flutter version from ".fvmrc" + uses: kuhnroyal/flutter-fvm-config-action/config@v3 + id: fvm-config-action with: path: '.fvmrc' + + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }} + channel: 'master' # https://github.com/subosito/flutter-action/issues/345#issuecomment-2657332687 cache: true - name: Install deps From 454d0faa83f1192cd53c7bf46242f3d1cfe3984c Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Sat, 18 Oct 2025 21:10:05 +0200 Subject: [PATCH 05/49] updates --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce2cc774..db5a9475 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,6 +68,7 @@ jobs: android: name: Test on Android + if: false runs-on: ubuntu-24.04 steps: - name: Checkout repository From b23b327608492b6ceb2b1db86b325573a0e86d4c Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Sat, 18 Oct 2025 22:32:43 +0200 Subject: [PATCH 06/49] updates --- .github/workflows/ci.yml | 31 +++++++++---------- .../integration_test/app_test.dart | 2 +- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db5a9475..f2c1fca4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ env: jobs: macos: name: Test on macOS - runs-on: macos-latest + runs-on: macos-15 steps: - name: Checkout repository uses: actions/checkout@v4 @@ -38,15 +38,15 @@ jobs: - name: Run tests shell: bash + working-directory: "src/serious_python/example/flet_example" run: | - export SERIOUS_PYTHON_SITE_PACKAGES=$GITHUB_WORKSPACE/site-packages - cd src/serious_python/example/flet_example dart run serious_python:main package app/src -p Darwin -r flet -r --pre - flutter test integration_test -d macos + flutter test integration_test --device-id macos ios: name: Test on iOS - runs-on: macos-latest + runs-on: macos-15 + if: false steps: - name: Checkout repository uses: actions/checkout@v4 @@ -57,19 +57,22 @@ jobs: path: '.fvmrc' cache: true - - name: Build iOS (no codesign) + - name: Build iOS shell: bash + working-directory: "src/serious_python/example/flet_example" run: | - export SERIOUS_PYTHON_SITE_PACKAGES=$GITHUB_WORKSPACE/site-packages - cd src/serious_python/example/flet_example dart run serious_python:main package app/src -p iOS -r flet -r --pre flutter build ios --no-codesign - # add simulator drive steps later if needed android: name: Test on Android - if: false runs-on: ubuntu-24.04 + env: + API_LEVEL: "33" + TARGET: "google_atd" + ARCH: "x86_64" + DEVICE_NAME: "android_emulator" + DEVICE_TYPE: "pixel_5" steps: - name: Checkout repository uses: actions/checkout@v4 @@ -89,7 +92,7 @@ jobs: - name: Setup Android SDK uses: android-actions/setup-android@v3 with: - packages: 'tools platform-tools' + packages: 'tools platform-tools platforms;android-${API_LEVEL}' - name: Accept SDK licenses shell: bash @@ -99,12 +102,6 @@ jobs: echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --licenses || true - name: Prepare Android emulator - env: - API_LEVEL: "33" - TARGET: "google_atd" - ARCH: "x86_64" - DEVICE_NAME: "android_emulator" - DEVICE_TYPE: "pixel_5" shell: bash run: | export PATH=$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$PATH diff --git a/src/serious_python/example/flet_example/integration_test/app_test.dart b/src/serious_python/example/flet_example/integration_test/app_test.dart index d32be512..880d75ff 100644 --- a/src/serious_python/example/flet_example/integration_test/app_test.dart +++ b/src/serious_python/example/flet_example/integration_test/app_test.dart @@ -10,7 +10,7 @@ void main() { testWidgets('make sure counter can be incremented and decremented', (tester) async { app.main(); - await tester.pumpAndSettle(); + await tester.pumpAndSettle(const Duration(seconds: 5)); // Wait for up to 10 seconds for the app to start bool counterFound = false; From d843ddde46b797db2b79812f5869e8ca8e6bc7f1 Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Sat, 18 Oct 2025 23:02:45 +0200 Subject: [PATCH 07/49] updates --- .github/workflows/ci.yml | 47 ++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f2c1fca4..f9b9a290 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,23 +92,28 @@ jobs: - name: Setup Android SDK uses: android-actions/setup-android@v3 with: - packages: 'tools platform-tools platforms;android-${API_LEVEL}' + packages: 'tools platform-tools' + accept-android-sdk-licenses: true + log-accepted-android-sdk-licenses: true - - name: Accept SDK licenses - shell: bash - run: | - sudo apt-get update - sudo apt-get install -y unzip - echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --licenses || true + #- name: Accept SDK licenses + # shell: bash + # run: | + # sudo apt-get update + # sudo apt-get install -y unzip + # echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --licenses || true - name: Prepare Android emulator shell: bash run: | export PATH=$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$PATH - sdkmanager "platform-tools" "platforms;android-${API_LEVEL}" + sdkmanager "platforms;android-${API_LEVEL}" sdkmanager --install "system-images;android-${API_LEVEL};${TARGET};${ARCH}" sdkmanager --update - echo "no" | avdmanager -v create avd --force --name "${DEVICE_NAME}" --package "system-images;android-${API_LEVEL};${TARGET};${ARCH}" --tag "${TARGET}" --sdcard 128M --device "${DEVICE_TYPE}" + echo "no" | avdmanager -v create avd --force --name "$DEVICE_NAME" --package "system-images;android-${API_LEVEL};${TARGET};${ARCH}" --tag "$TARGET" --sdcard 128M --device "$DEVICE_TYPE" + ls -al ~/.android/avd + sudo adduser $USER kvm + sudo chown $USER /dev/kvm ${ANDROID_HOME}/emulator/emulator -avd "${DEVICE_NAME}" -memory 2048 -wipe-data -no-boot-anim -noaudio -no-window -accel off -partition-size 8192 & adb wait-for-device shell 'while [[ -z $(getprop dev.bootcomplete) ]]; do sleep 1; done;' @@ -119,6 +124,30 @@ jobs: dart run serious_python:main package app/src -p Android -r flet -r --pre flutter test integration_test -d emulator-5554 + emulator: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v4 + + - 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: Run Android Emulator + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: 33 + target: google_atd + arch: x86_64 + profile: pixel_5 + emulator-options: -no-window -noaudio -no-boot-anim + script: | + adb shell getprop ro.product.model + ./gradlew connectedCheck + windows: name: Test on Windows runs-on: windows-latest From dd267651746393bd04a113ef2b3c9efd25eacc64 Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Sat, 18 Oct 2025 23:12:48 +0200 Subject: [PATCH 08/49] updates --- .github/workflows/ci.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9b9a290..6994899c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -136,6 +136,18 @@ jobs: 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 + - name: Run Android Emulator uses: reactivecircus/android-emulator-runner@v2 with: From 1e96d83e0bf8e59cdf2cfe2e252aa53755bd0068 Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Sat, 18 Oct 2025 23:29:23 +0200 Subject: [PATCH 09/49] updates --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6994899c..748ba02a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -159,6 +159,10 @@ jobs: script: | adb shell getprop ro.product.model ./gradlew connectedCheck + sdkmanager --list_installed + sdkmanager "platforms;android-33" "system-images;android-33;google_atd;x86_6" + sdkmanager --list_installed + sdkmanager --update windows: name: Test on Windows From c83ccad21bbece587a6b76866d05a8ee99462d56 Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Sat, 18 Oct 2025 23:41:03 +0200 Subject: [PATCH 10/49] updates --- .github/workflows/ci.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 748ba02a..a772d85f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -155,14 +155,17 @@ jobs: target: google_atd arch: x86_64 profile: pixel_5 - emulator-options: -no-window -noaudio -no-boot-anim + sdcard-path-or-size: "128M" + emulator-options: -no-window -noaudio -no-boot-anim -memory 2048 -wipe-data -cache-size 1000 -noaudio -no-window -partition-size 8192 script: | adb shell getprop ro.product.model ./gradlew connectedCheck - sdkmanager --list_installed - sdkmanager "platforms;android-33" "system-images;android-33;google_atd;x86_6" + echo "XXXXXX Emulator test run completed." sdkmanager --list_installed sdkmanager --update + sdkmanager --list_installed + adb wait-for-device shell 'while [[ -z $(getprop dev.bootcomplete) ]]; do sleep 1; done;' + echo "XXXXXX END" windows: name: Test on Windows From 325a258fc9926aed4ff6a1dc70764cd02ec7b2b0 Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Sat, 18 Oct 2025 23:45:05 +0200 Subject: [PATCH 11/49] updates --- .github/workflows/ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a772d85f..9290e71c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -158,7 +158,6 @@ jobs: sdcard-path-or-size: "128M" emulator-options: -no-window -noaudio -no-boot-anim -memory 2048 -wipe-data -cache-size 1000 -noaudio -no-window -partition-size 8192 script: | - adb shell getprop ro.product.model ./gradlew connectedCheck echo "XXXXXX Emulator test run completed." sdkmanager --list_installed @@ -166,6 +165,13 @@ jobs: sdkmanager --list_installed adb wait-for-device shell 'while [[ -z $(getprop dev.bootcomplete) ]]; do sleep 1; done;' echo "XXXXXX END" + pre-emulator-launch-script: | + echo "XXXXXX Emulator test run completed." + sdkmanager --list_installed + sdkmanager --update + sdkmanager --list_installed + echo "XXXXXX END" + windows: name: Test on Windows From 580782ff0b874a7b57522a59bc040d0ce293f791 Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Sat, 18 Oct 2025 23:59:49 +0200 Subject: [PATCH 12/49] updates --- .github/workflows/ci.yml | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9290e71c..5bb328c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -130,6 +130,9 @@ jobs: - name: checkout uses: actions/checkout@v4 + - name: Setup SDK for Android + uses: android-actions/setup-android@v3 + - name: Enable KVM run: | echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules @@ -151,26 +154,31 @@ jobs: - name: Run Android Emulator uses: reactivecircus/android-emulator-runner@v2 with: + avd-name: android_emulator api-level: 33 target: google_atd arch: x86_64 profile: pixel_5 - sdcard-path-or-size: "128M" - emulator-options: -no-window -noaudio -no-boot-anim -memory 2048 -wipe-data -cache-size 1000 -noaudio -no-window -partition-size 8192 + sdcard-path-or-size: 128M + ram-size: 2048M + disk-size: 4096M + disable-animations: true + cmake: 3.10.2.4988404 + emulator-options: -no-window -noaudio -no-boot-anim -memory 2048 -wipe-data -cache-size 1000 -partition-size 8192 + pre-emulator-launch-script: | + sdkmanager --list_installed script: | + adb wait-for-device + adb shell input keyevent 82 + adb shell pm list instrumentation + adb devices && adb shell getprop + ./gradlew :example:assembleDebugAndroidTest + ./gradlew :lib:assembleDebugAndroidTest + ./gradlew :lib:testDebugUnitTest && ./gradlew jacocoFullReport --info + ./gradlew connectedCheck - echo "XXXXXX Emulator test run completed." - sdkmanager --list_installed - sdkmanager --update - sdkmanager --list_installed adb wait-for-device shell 'while [[ -z $(getprop dev.bootcomplete) ]]; do sleep 1; done;' - echo "XXXXXX END" - pre-emulator-launch-script: | - echo "XXXXXX Emulator test run completed." - sdkmanager --list_installed - sdkmanager --update - sdkmanager --list_installed - echo "XXXXXX END" + echo "XXXXXX YYY ZZZ" windows: From b4329812c40c0896dbab57bd9419a5c84e65fc5e Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Sun, 19 Oct 2025 00:12:05 +0200 Subject: [PATCH 13/49] updates --- .github/workflows/ci.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5bb328c6..0e0608ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -107,11 +107,11 @@ jobs: shell: bash run: | export PATH=$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$PATH + sdkmanager --list_installed sdkmanager "platforms;android-${API_LEVEL}" sdkmanager --install "system-images;android-${API_LEVEL};${TARGET};${ARCH}" sdkmanager --update echo "no" | avdmanager -v create avd --force --name "$DEVICE_NAME" --package "system-images;android-${API_LEVEL};${TARGET};${ARCH}" --tag "$TARGET" --sdcard 128M --device "$DEVICE_TYPE" - ls -al ~/.android/avd sudo adduser $USER kvm sudo chown $USER /dev/kvm ${ANDROID_HOME}/emulator/emulator -avd "${DEVICE_NAME}" -memory 2048 -wipe-data -no-boot-anim -noaudio -no-window -accel off -partition-size 8192 & @@ -162,21 +162,20 @@ jobs: sdcard-path-or-size: 128M ram-size: 2048M disk-size: 4096M + emulator-port: 5554 disable-animations: true cmake: 3.10.2.4988404 emulator-options: -no-window -noaudio -no-boot-anim -memory 2048 -wipe-data -cache-size 1000 -partition-size 8192 pre-emulator-launch-script: | sdkmanager --list_installed script: | + adb logcat -c + adb logcat & adb wait-for-device adb shell input keyevent 82 adb shell pm list instrumentation adb devices && adb shell getprop - ./gradlew :example:assembleDebugAndroidTest - ./gradlew :lib:assembleDebugAndroidTest - ./gradlew :lib:testDebugUnitTest && ./gradlew jacocoFullReport --info - ./gradlew connectedCheck adb wait-for-device shell 'while [[ -z $(getprop dev.bootcomplete) ]]; do sleep 1; done;' echo "XXXXXX YYY ZZZ" From ac6f512818ed1679428f7cfce35775f69ff02974 Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Sun, 19 Oct 2025 00:21:48 +0200 Subject: [PATCH 14/49] updates --- .github/workflows/ci.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e0608ac..37844c0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,7 +114,7 @@ jobs: echo "no" | avdmanager -v create avd --force --name "$DEVICE_NAME" --package "system-images;android-${API_LEVEL};${TARGET};${ARCH}" --tag "$TARGET" --sdcard 128M --device "$DEVICE_TYPE" sudo adduser $USER kvm sudo chown $USER /dev/kvm - ${ANDROID_HOME}/emulator/emulator -avd "${DEVICE_NAME}" -memory 2048 -wipe-data -no-boot-anim -noaudio -no-window -accel off -partition-size 8192 & + emulator -avd "${DEVICE_NAME}" -memory 2048 -wipe-data -no-boot-anim -noaudio -no-window -accel off -partition-size 8192 & adb wait-for-device shell 'while [[ -z $(getprop dev.bootcomplete) ]]; do sleep 1; done;' - name: Run tests @@ -164,20 +164,22 @@ jobs: disk-size: 4096M emulator-port: 5554 disable-animations: true - cmake: 3.10.2.4988404 + # cmake: 3.10.2.4988404 emulator-options: -no-window -noaudio -no-boot-anim -memory 2048 -wipe-data -cache-size 1000 -partition-size 8192 pre-emulator-launch-script: | sdkmanager --list_installed script: | - adb logcat -c - adb logcat & - adb wait-for-device - adb shell input keyevent 82 - adb shell pm list instrumentation adb devices && adb shell getprop - - adb wait-for-device shell 'while [[ -z $(getprop dev.bootcomplete) ]]; do sleep 1; done;' - echo "XXXXXX YYY ZZZ" + cd src/serious_python/example/flet_example + dart run serious_python:main package app/src -p Android -r flet -r --pre + flutter test integration_test -d emulator-5554 + + - name: Run tests + shell: bash + working-directory: "src/serious_python/example/flet_example" + run: | + dart run serious_python:main package app/src -p Android -r flet -r --pre + flutter test integration_test -d emulator-5554 windows: From 87b4b2e80b92e0726f02e6a3b72d916290276837 Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Sun, 19 Oct 2025 00:28:14 +0200 Subject: [PATCH 15/49] updates --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37844c0c..709c371d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -130,6 +130,12 @@ jobs: - name: checkout uses: actions/checkout@v4 + - name: Setup Flutter + uses: kuhnroyal/flutter-fvm-config-action/setup@v3 + with: + path: '.fvmrc' + cache: true + - name: Setup SDK for Android uses: android-actions/setup-android@v3 From 6d373c04d6f7dd217d2ab61045a8a36b75e45eb7 Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Sun, 19 Oct 2025 00:40:21 +0200 Subject: [PATCH 16/49] updates --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 709c371d..6c53b0f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -127,7 +127,7 @@ jobs: emulator: runs-on: ubuntu-latest steps: - - name: checkout + - name: Checkout repository uses: actions/checkout@v4 - name: Setup Flutter @@ -175,8 +175,8 @@ jobs: pre-emulator-launch-script: | sdkmanager --list_installed script: | - adb devices && adb shell getprop cd src/serious_python/example/flet_example + ls -la dart run serious_python:main package app/src -p Android -r flet -r --pre flutter test integration_test -d emulator-5554 From 6e069cc282d61974c1e21daa42b0389d964db9ec Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Sun, 19 Oct 2025 00:46:54 +0200 Subject: [PATCH 17/49] updates --- .github/workflows/ci.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c53b0f2..cb874b3f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -175,10 +175,9 @@ jobs: pre-emulator-launch-script: | sdkmanager --list_installed script: | - cd src/serious_python/example/flet_example - ls -la - dart run serious_python:main package app/src -p Android -r flet -r --pre - flutter test integration_test -d emulator-5554 + cd src/serious_python/example/flet_example && ls -la + cd src/serious_python/example/flet_example && dart run serious_python:main package app/src -p Android -r flet -r --pre + cd src/serious_python/example/flet_example && flutter test integration_test -d emulator-5554 - name: Run tests shell: bash From 7b2417960ea5295a5b516dcd61f41af9bf0815c2 Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Sun, 19 Oct 2025 01:46:37 +0200 Subject: [PATCH 18/49] update --- .github/workflows/ci.yml | 84 +++++----------------------------------- 1 file changed, 10 insertions(+), 74 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb874b3f..279c6926 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,6 @@ jobs: ios: name: Test on iOS runs-on: macos-15 - if: false steps: - name: Checkout repository uses: actions/checkout@v4 @@ -57,74 +56,24 @@ jobs: path: '.fvmrc' cache: true + - name: Launch iOS Simulator + uses: futureware-tech/simulator-action@v4 + with: + model: 'iPhone 16' + shutdown_after_job: true + wait_for_boot: true + - name: Build iOS shell: bash working-directory: "src/serious_python/example/flet_example" run: | + flutter devices dart run serious_python:main package app/src -p iOS -r flet -r --pre flutter build ios --no-codesign + android: name: Test on Android - runs-on: ubuntu-24.04 - env: - API_LEVEL: "33" - TARGET: "google_atd" - ARCH: "x86_64" - DEVICE_NAME: "android_emulator" - DEVICE_TYPE: "pixel_5" - 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: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' - - - name: Setup Android SDK - uses: android-actions/setup-android@v3 - with: - packages: 'tools platform-tools' - accept-android-sdk-licenses: true - log-accepted-android-sdk-licenses: true - - #- name: Accept SDK licenses - # shell: bash - # run: | - # sudo apt-get update - # sudo apt-get install -y unzip - # echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --licenses || true - - - name: Prepare Android emulator - shell: bash - run: | - export PATH=$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$PATH - sdkmanager --list_installed - sdkmanager "platforms;android-${API_LEVEL}" - sdkmanager --install "system-images;android-${API_LEVEL};${TARGET};${ARCH}" - sdkmanager --update - echo "no" | avdmanager -v create avd --force --name "$DEVICE_NAME" --package "system-images;android-${API_LEVEL};${TARGET};${ARCH}" --tag "$TARGET" --sdcard 128M --device "$DEVICE_TYPE" - sudo adduser $USER kvm - sudo chown $USER /dev/kvm - emulator -avd "${DEVICE_NAME}" -memory 2048 -wipe-data -no-boot-anim -noaudio -no-window -accel off -partition-size 8192 & - adb wait-for-device shell 'while [[ -z $(getprop dev.bootcomplete) ]]; do sleep 1; done;' - - - name: Run tests - shell: bash - run: | - cd src/serious_python/example/flet_example - dart run serious_python:main package app/src -p Android -r flet -r --pre - flutter test integration_test -d emulator-5554 - - emulator: runs-on: ubuntu-latest steps: - name: Checkout repository @@ -136,9 +85,6 @@ jobs: path: '.fvmrc' cache: true - - name: Setup SDK for Android - uses: android-actions/setup-android@v3 - - name: Enable KVM run: | echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules @@ -170,22 +116,12 @@ jobs: disk-size: 4096M emulator-port: 5554 disable-animations: true - # cmake: 3.10.2.4988404 emulator-options: -no-window -noaudio -no-boot-anim -memory 2048 -wipe-data -cache-size 1000 -partition-size 8192 pre-emulator-launch-script: | sdkmanager --list_installed script: | - cd src/serious_python/example/flet_example && ls -la cd src/serious_python/example/flet_example && dart run serious_python:main package app/src -p Android -r flet -r --pre - cd src/serious_python/example/flet_example && flutter test integration_test -d emulator-5554 - - - name: Run tests - shell: bash - working-directory: "src/serious_python/example/flet_example" - run: | - dart run serious_python:main package app/src -p Android -r flet -r --pre - flutter test integration_test -d emulator-5554 - + cd src/serious_python/example/flet_example && flutter test integration_test --device-id emulator-5554 windows: name: Test on Windows From 8cf22dce00bdbd4ec84bd512fa92b96e269379c2 Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Sun, 19 Oct 2025 02:00:11 +0200 Subject: [PATCH 19/49] update --- .github/workflows/ci.yml | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 279c6926..3bbded9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,6 @@ jobs: dart run serious_python:main package app/src -p iOS -r flet -r --pre flutter build ios --no-codesign - android: name: Test on Android runs-on: ubuntu-latest @@ -137,9 +136,9 @@ jobs: cache: true - name: Run tests - shell: pwsh + shell: bash + working-directory: "src/serious_python/example/flet_example" run: | - cd src/serious_python/example/flet_example dart run serious_python:main package app/src -p Windows -r flet -r --pre flutter test integration_test -d windows @@ -180,8 +179,8 @@ jobs: - name: Run tests shell: bash + working-directory: "src/serious_python/example/flet_example" run: | - cd src/serious_python/example/flet_example dart run serious_python:main package app/src -p Linux -r flet -r --pre xvfb-run flutter test integration_test -d linux @@ -208,14 +207,14 @@ jobs: - name: Install deps shell: bash run: | - sudo sed -i "/#\$nrconf{restart} = 'i';/s/.*/\$nrconf{restart} = 'a';/" /etc/needrestart/needrestart.conf + # sudo sed -i "/#\$nrconf{restart} = 'i';/s/.*/\$nrconf{restart} = 'a';/" /etc/needrestart/needrestart.conf sudo apt-get update -y --allow-releaseinfo-change sudo apt-get install -y clang ninja-build xvfb libgtk-3-dev gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav - name: Run tests shell: bash + working-directory: "src/serious_python/example/flet_example" run: | - cd src/serious_python/example/flet_example dart run serious_python:main package app/src -p Linux -r flet -r --pre xvfb-run flutter test integration_test -d linux @@ -260,19 +259,27 @@ jobs: echo "$PUB_DEV_TOKEN" | base64 --decode > $HOME/.config/dart/pub-credentials.json - name: Patch pubspec versions + shell: bash + working-directory: "src" run: | - uv run "$SCRIPTS/patch_pubspec.py" "src/serious_python_platform_interface/pubspec.yaml" "$PKG_VER" - uv run "$SCRIPTS/patch_pubspec.py" "src/serious_python/pubspec.yaml" "$PKG_VER" - uv run "$SCRIPTS/patch_pubspec.py" "src/serious_python_android/pubspec.yaml" "$PKG_VER" - uv run "$SCRIPTS/patch_pubspec.py" "src/serious_python_darwin/pubspec.yaml" "$PKG_VER" - uv run "$SCRIPTS/patch_pubspec.py" "src/serious_python_windows/pubspec.yaml" "$PKG_VER" - uv run "$SCRIPTS/patch_pubspec.py" "src/serious_python_linux/pubspec.yaml" "$PKG_VER" + for pkg in \ + "serious_python" \ + "serious_python_platform_interface" \ + "serious_python_android" \ + "serious_python_darwin" \ + "serious_python_windows" \ + "serious_python_linux"; do + uv run "$SCRIPTS/patch_pubspec.py" "$pkg/pubspec.yaml" "$PKG_VER" + done - name: Publish packages shell: bash - if: false run: | - publish_pkg () { pushd "$1" >/dev/null; dart pub publish --force; popd >/dev/null; } + publish_pkg () { + pushd "$1" >/dev/null + dart pub publish --force --dry-run + popd >/dev/null + } publish_pkg src/serious_python_platform_interface sleep 600 From 439bdf48de7addea51c8f1d186b323b6dcff37c0 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Mon, 20 Oct 2025 09:30:34 -0700 Subject: [PATCH 20/49] Add ELF 16KB alignment check script and CMake flags Introduces a comprehensive shell script to check ELF segment alignment for Android 16KB page size compatibility, addressing upcoming Google Play requirements. Updates CMakeLists.txt to set linker flags for 16KB page size support when building for Android, ensuring native libraries are compliant for Android 15+. --- .github/scripts/check_elf_alignment.sh | 699 ++++++++++++++++++ src/serious_python_android/src/CMakeLists.txt | 7 + 2 files changed, 706 insertions(+) create mode 100755 .github/scripts/check_elf_alignment.sh diff --git a/.github/scripts/check_elf_alignment.sh b/.github/scripts/check_elf_alignment.sh new file mode 100755 index 00000000..d8db1291 --- /dev/null +++ b/.github/scripts/check_elf_alignment.sh @@ -0,0 +1,699 @@ +#!/bin/bash + +# Enhanced ELF Alignment Checker for Android 16KB Page Size Compatibility +# This script checks if your app's native libraries are compatible with 16KB page size devices +# as required by Google Play starting November 1st, 2025 for apps targeting Android 15+ + +progname="${0##*/}" +progname="${progname%.sh}" + +# Color codes and formatting - detect if colors are supported +if [[ -t 1 ]] && command -v tput >/dev/null 2>&1 && tput colors >/dev/null 2>&1 && [[ $(tput colors) -ge 8 ]]; then + RED="\033[31m" + GREEN="\033[32m" + YELLOW="\033[33m" + BLUE="\033[34m" + CYAN="\033[36m" + PURPLE="\033[35m" + BOLD="\033[1m" + DIM="\033[2m" + ENDCOLOR="\033[0m" + USE_COLORS=true +else + # No color support - use plain text + RED="" + GREEN="" + YELLOW="" + BLUE="" + CYAN="" + PURPLE="" + BOLD="" + DIM="" + ENDCOLOR="" + USE_COLORS=false +fi + +# Unicode symbols with fallbacks +if [[ $USE_COLORS == true ]]; then + CHECK_MARK="āœ“" + CROSS_MARK="āœ—" + WARNING_MARK="⚠" + INFO_MARK="ℹ" + ROCKET="šŸš€" + GEAR="āš™" + PACKAGE="šŸ“¦" + DOCUMENT="šŸ“„" + ALERT="🚨" + PARTY="šŸŽ‰" + TOOLS="šŸ”§" + BOOKS="šŸ“š" + ARROW="ā–¶" +else + CHECK_MARK="[OK]" + CROSS_MARK="[X]" + WARNING_MARK="[!]" + INFO_MARK="[i]" + ROCKET="[>]" + GEAR="[*]" + PACKAGE="[P]" + DOCUMENT="[D]" + ALERT="[!]" + PARTY="[*]" + TOOLS="[T]" + BOOKS="[B]" + ARROW=">" +fi + +# Enhanced formatting functions +print_banner() { + local title="$1" + local subtitle="$2" + local width=88 + + echo + printf "%*s\n" $width | tr ' ' '═' + + # Main title + local title_len=${#title} + local title_padding=$(( (width - title_len - 4) / 2 )) + printf "ā•‘${BOLD}${BLUE}%*s %s %*s${ENDCOLOR}ā•‘\n" \ + $title_padding "" "$title" $title_padding "" + + # Subtitle if provided + if [[ -n "$subtitle" ]]; then + local subtitle_len=${#subtitle} + local subtitle_padding=$(( (width - subtitle_len - 4) / 2 )) + printf "ā•‘${DIM}%*s %s %*s${ENDCOLOR}ā•‘\n" \ + $subtitle_padding "" "$subtitle" $subtitle_padding "" + fi + + printf "%*s\n" $width | tr ' ' '═' + echo +} + +print_section() { + local icon="$1" + local title="$2" + local description="$3" + + echo + echo -e "${BOLD}${BLUE}$icon $title${ENDCOLOR}" + if [[ -n "$description" ]]; then + echo -e "${DIM}$description${ENDCOLOR}" + fi + printf "${BLUE}%*s${ENDCOLOR}\n" 80 | tr ' ' '─' +} + +print_status() { + local status="$1" + local message="$2" + local detail="$3" + + case $status in + "success") + printf " ${GREEN}${CHECK_MARK}${ENDCOLOR} %s" "$message" + ;; + "error") + printf " ${RED}${CROSS_MARK}${ENDCOLOR} %s" "$message" + ;; + "warning") + printf " ${YELLOW}${WARNING_MARK}${ENDCOLOR} %s" "$message" + ;; + "info") + printf " ${CYAN}${INFO_MARK}${ENDCOLOR} %s" "$message" + ;; + "processing") + printf " ${PURPLE}${GEAR}${ENDCOLOR} %s" "$message" + ;; + esac + + if [[ -n "$detail" ]]; then + printf "\n ${DIM}%s${ENDCOLOR}" "$detail" + fi + echo +} + +print_subsection() { + local title="$1" + echo + echo -e " ${BOLD}${PURPLE}${ARROW} $title${ENDCOLOR}" + printf " ${PURPLE}%*s${ENDCOLOR}\n" 50 | tr ' ' 'ā”ˆ' +} + +print_table_header() { + echo + local line1="ā”Œ$(printf '─%.0s' {1..29})┬$(printf '─%.0s' {1..18})┬$(printf '─%.0s' {1..15})┬$(printf '─%.0s' {1..13})┐" + local line2="│ $(printf '%-27s' 'Library') │ $(printf '%-16s' 'Architecture') │ $(printf '%-13s' 'Alignment') │ $(printf '%-11s' 'Status') │" + local line3="ā”œ$(printf '─%.0s' {1..29})┼$(printf '─%.0s' {1..18})┼$(printf '─%.0s' {1..15})┼$(printf '─%.0s' {1..13})┤" + + echo -e "${CYAN}$line1${ENDCOLOR}" + echo -e "${BOLD}${CYAN}$line2${ENDCOLOR}" + echo -e "${CYAN}$line3${ENDCOLOR}" +} + +print_table_row() { + local lib="$1" + local arch="$2" + local alignment="$3" + local status="$4" + local is_critical="$5" + + local status_symbol + local status_color + local status_text + + if [[ $status == "ALIGNED" ]]; then + status_symbol="$CHECK_MARK" + status_color="$GREEN" + status_text="PASS" + else + status_symbol="$CROSS_MARK" + if [[ $is_critical == "true" ]]; then + status_color="$RED" + status_text="FAIL" + else + status_color="$YELLOW" + status_text="WARN" + fi + fi + + # Truncate library name if too long + local display_lib="$lib" + if [[ ${#lib} -gt 27 ]]; then + display_lib="${lib:0:24}..." + fi + + printf "${CYAN}│${ENDCOLOR} %-27s ${CYAN}│${ENDCOLOR} %-16s ${CYAN}│${ENDCOLOR} %-13s ${CYAN}│${ENDCOLOR} ${status_color}%s %-7s${ENDCOLOR} ${CYAN}│${ENDCOLOR}\n" \ + "$display_lib" "$arch" "$alignment" "$status_symbol" "$status_text" + + if [[ $is_critical == "true" && $status == "UNALIGNED" ]]; then + printf "${CYAN}│${ENDCOLOR} ${RED}%-75s${ENDCOLOR} ${CYAN}│${ENDCOLOR}\n" " ${ALERT} CRITICAL: Required for Google Play compliance!" + fi +} + +print_table_footer() { + local line="ā””$(printf '─%.0s' {1..29})┓$(printf '─%.0s' {1..18})┓$(printf '─%.0s' {1..15})┓$(printf '─%.0s' {1..13})ā”˜" + echo -e "${CYAN}$line${ENDCOLOR}" + echo +} + +print_summary_box() { + local title="$1" + local status="$2" # success, warning, error + shift 2 + local lines=("$@") + + local box_color + local title_color + case $status in + "success") box_color="$GREEN"; title_color="$GREEN" ;; + "warning") box_color="$YELLOW"; title_color="$YELLOW" ;; + "error") box_color="$RED"; title_color="$RED" ;; + *) box_color="$BLUE"; title_color="$BLUE" ;; + esac + + local width=78 + echo + printf "${box_color}ā”Œ%*s┐${ENDCOLOR}\n" $((width-2)) | tr ' ' '─' + + # Title + local title_len=${#title} + local title_padding=$(( (width - title_len - 4) / 2 )) + printf "${box_color}│${ENDCOLOR}${BOLD}${title_color}%*s %s %*s${ENDCOLOR}${box_color}│${ENDCOLOR}\n" \ + $title_padding "" "$title" $title_padding "" + + printf "${box_color}ā”œ%*s┤${ENDCOLOR}\n" $((width-2)) | tr ' ' '─' + + # Content lines + for line in "${lines[@]}"; do + printf "${box_color}│${ENDCOLOR} %-*s ${box_color}│${ENDCOLOR}\n" $((width-4)) "$line" + done + + printf "${box_color}ā””%*sā”˜${ENDCOLOR}\n" $((width-2)) | tr ' ' '─' + echo +} + +cleanup_trap() { + if [ -n "${tmp}" -a -d "${tmp}" ]; then + print_status "processing" "Cleaning up temporary files..." + rm -rf "${tmp}" + fi + exit $1 +} + +usage() { + print_banner "Android 16KB Page Size Compatibility Checker" "Google Play Compliance Tool" + + echo -e "${BOLD}DESCRIPTION:${ENDCOLOR}" + echo " This tool verifies that your Android app's native libraries are compatible" + echo " with 16KB page size devices, as required by Google Play starting November 1st, 2025." + echo + + echo -e "${BOLD}USAGE:${ENDCOLOR}" + echo -e " ${GREEN}$progname${ENDCOLOR} ${CYAN}[input-path|input-APK|input-APEX]${ENDCOLOR}" + echo + + echo -e "${BOLD}EXAMPLES:${ENDCOLOR}" + echo -e " ${DIM}# Check an APK file${ENDCOLOR}" + echo -e " $progname ${CYAN}app/build/outputs/apk/release/app-release.apk${ENDCOLOR}" + echo + echo -e " ${DIM}# Check a directory of native libraries${ENDCOLOR}" + echo -e " $progname ${CYAN}/path/to/native/libs/${ENDCOLOR}" + echo + + echo -e "${BOLD}WHAT THIS TOOL CHECKS:${ENDCOLOR}" + echo -e " ${CHECK_MARK} APK zip-alignment for 16KB boundaries (requires build-tools 35.0.0+)" + echo -e " ${CHECK_MARK} ELF segment alignment in native libraries (arm64-v8a and x86_64)" + echo -e " ${CHECK_MARK} Compliance with Android 16KB page size requirements" + echo + + echo -e "${BOLD}RESULT MEANINGS:${ENDCOLOR}" + echo -e " ${GREEN}${CHECK_MARK} PASS${ENDCOLOR} - Library is compatible with 16KB page sizes (2**14 or higher)" + echo -e " ${RED}${CROSS_MARK} FAIL${ENDCOLOR} - Library needs recompilation with 16KB ELF alignment" + echo -e " ${YELLOW}${WARNING_MARK} WARN${ENDCOLOR} - Non-critical architecture but should be fixed" + echo +} + +# Enhanced dependency checking +check_dependencies() { + print_section "$GEAR" "Dependency Check" "Verifying required tools are available" + + local missing_tools=() + local available_tools=() + + # Check each tool + local tools=("objdump" "unzip" "file") + for tool in "${tools[@]}"; do + if command -v "$tool" >/dev/null 2>&1; then + available_tools+=("$tool") + print_status "success" "$tool" "$(which "$tool")" + else + missing_tools+=("$tool") + print_status "error" "$tool not found" + fi + done + + if [ ${#missing_tools[@]} -gt 0 ]; then + echo + print_subsection "Installation Instructions" + for tool in "${missing_tools[@]}"; do + case $tool in + objdump) + print_status "info" "Install objdump:" "macOS: Xcode Command Line Tools or Android NDK's llvm-objdump" + print_status "info" "" "Linux: sudo apt-get install binutils (Ubuntu/Debian)" + ;; + unzip) + print_status "info" "Install unzip:" "Usually pre-installed on most systems" + print_status "info" "" "Linux: sudo apt-get install unzip" + ;; + file) + print_status "info" "Install file:" "Usually pre-installed on most systems" + print_status "info" "" "Linux: sudo apt-get install file" + ;; + esac + echo + done + exit 1 + fi + + print_status "success" "All dependencies satisfied" "${#available_tools[@]} tools available" +} + +# Validate input arguments +if [ ${#} -ne 1 ]; then + usage + exit 1 +fi + +case ${1} in + --help | -h | -\?) + usage + exit 0 + ;; + *) + dir="${1}" + ;; +esac + +# Validate input file/directory +if ! [ -f "${dir}" -o -d "${dir}" ]; then + print_status "error" "Invalid input: ${dir}" + echo " Please provide a valid APK file, APEX file, or directory containing native libraries." + exit 1 +fi + +# Check dependencies before proceeding +check_dependencies + +print_banner "ANALYSIS IN PROGRESS" "Checking 16KB Page Size Compatibility" + +print_status "processing" "Target: $(basename "${dir}")" +print_status "info" "Compliance Deadline: November 1st, 2025" +print_status "info" "Requirement: Apps targeting Android 15+ must support 16KB pages" + +# APK Processing +if [[ "${dir}" == *.apk ]]; then + trap 'cleanup_trap' EXIT + + print_section "$PACKAGE" "APK Analysis" "Processing Android Package file" + + # Enhanced zipalign check + if command -v zipalign >/dev/null 2>&1; then + if { zipalign --help 2>&1 | grep -q "\-P "; }; then + print_status "processing" "Checking APK zip-alignment for 16KB boundaries..." + + zip_result=$(zipalign -v -c -P 16 4 "${dir}" 2>&1) + zip_exit_code=$? + + if [ $zip_exit_code -eq 0 ]; then + print_status "success" "APK zip-alignment verification passed" + else + print_status "error" "APK zip-alignment verification failed" + echo " ${DIM}Details:${ENDCOLOR}" + echo "$zip_result" | grep -E 'lib/arm64-v8a|lib/x86_64|Verification|would be' | sed 's/^/ /' || echo " $zip_result" + fi + else + print_status "warning" "zipalign version doesn't support 16KB alignment checks" + print_status "info" "Solution: Update to Android SDK build-tools 35.0.0+" + echo " ${DIM}Update via Android Studio → SDK Manager → SDK Tools${ENDCOLOR}" + echo " ${DIM}Or run: sdkmanager \"build-tools;35.0.0\"${ENDCOLOR}" + fi + else + print_status "warning" "zipalign not found in PATH" + print_status "info" "Ensure Android SDK build-tools are installed and in PATH" + fi + + # Extract APK + dir_filename=$(basename "${dir}") + tmp=$(mktemp -d -t "${dir_filename%.apk}_out_XXXXX") + + if [ ! -d "${tmp}" ]; then + print_status "error" "Failed to create temporary directory" + exit 1 + fi + + print_status "processing" "Extracting native libraries from APK..." + if ! unzip -q "${dir}" "lib/*" -d "${tmp}" 2>/dev/null; then + print_summary_box "NO NATIVE LIBRARIES FOUND" "success" \ + "${PARTY} Your app contains only Java/Kotlin code!" \ + "" \ + "${CHECK_MARK} Apps without native libraries automatically support 16KB devices" \ + "${CHECK_MARK} No additional changes required for Google Play compliance" \ + "${CHECK_MARK} You're all set for the November 1st, 2025 deadline!" + cleanup_trap 0 + fi + + dir="${tmp}" +fi + +# APEX Processing +if [[ "${dir}" == *.apex ]]; then + trap 'cleanup_trap' EXIT + + print_section "$DOCUMENT" "APEX Analysis" "Processing Android Pony EXpress file" + + if ! command -v deapexer >/dev/null 2>&1; then + print_status "error" "deapexer tool not found" + echo " Please ensure Android SDK tools are properly installed and in your PATH." + exit 1 + fi + + dir_filename=$(basename "${dir}") + tmp=$(mktemp -d -t "${dir_filename%.apex}_out_XXXXX") + + if [ ! -d "${tmp}" ]; then + print_status "error" "Failed to create temporary directory" + exit 1 + fi + + print_status "processing" "Extracting APEX contents..." + if ! deapexer extract "${dir}" "${tmp}"; then + print_status "error" "Failed to extract APEX file" + cleanup_trap 1 + fi + + dir="${tmp}" +fi + +# Track libraries for enhanced summary +unaligned_libs=() +aligned_libs=() +critical_unaligned_libs=() +non_critical_unaligned_libs=() +total_libs=0 +critical_libs=0 + +print_section "$GEAR" "ELF Segment Analysis" "Scanning native libraries for 16KB alignment compliance" + +# Find all native libraries +matches="$(find "${dir}" -type f -name '*.so' 2>/dev/null)" +if [ -z "$matches" ]; then + # Also check for ELF files without .so extension + matches="$(find "${dir}" -type f -exec file {} \; 2>/dev/null | grep 'ELF' | cut -d: -f1)" +fi + +if [ -z "$matches" ]; then + print_summary_box "NO NATIVE LIBRARIES DETECTED" "success" \ + "${PARTY} Your app uses only Java/Kotlin code!" \ + "" \ + "${CHECK_MARK} No native library alignment issues to worry about" \ + "${CHECK_MARK} Already compatible with 16KB page size devices" \ + "${CHECK_MARK} Ready for Google Play's November 1st, 2025 requirement!" + cleanup_trap 0 +fi + +print_status "info" "Found native libraries - analyzing ELF segment alignment..." + +print_table_header + +IFS=$'\n' +for match in $matches; do + # Skip non-ELF files and nested packages + if [[ "${match}" == *".apk" ]]; then + continue + fi + if [[ "${match}" == *".apex" ]]; then + continue + fi + + # Verify it's actually an ELF file + if ! [[ $(file "${match}" 2>/dev/null) == *"ELF"* ]]; then + continue + fi + + total_libs=$((total_libs + 1)) + + # Determine architecture and criticality + arch="unknown" + is_critical="false" + if [[ "${match}" == *"arm64-v8a"* ]]; then + arch="arm64-v8a" + is_critical="true" + critical_libs=$((critical_libs + 1)) + elif [[ "${match}" == *"x86_64"* ]]; then + arch="x86_64" + is_critical="true" + critical_libs=$((critical_libs + 1)) + elif [[ "${match}" == *"armeabi-v7a"* ]]; then + arch="armeabi-v7a" + elif [[ "${match}" == *"x86"* ]]; then + arch="x86" + fi + + # Check ELF segment alignment + res="$(objdump -p "${match}" 2>/dev/null | grep LOAD | awk '{ print $NF }' | head -1)" + + if [ -z "$res" ]; then + print_table_row "$(basename "${match}")" "$arch" "UNKNOWN" "FAILED" "$is_critical" + continue + fi + + # Check if alignment meets 16KB requirement (2**14 or higher) + if [[ $res =~ 2\*\*(1[4-9]|[2-9][0-9]|[1-9][0-9]{2,}) ]]; then + print_table_row "$(basename "${match}")" "$arch" "$res" "ALIGNED" "$is_critical" + aligned_libs+=("${match}") + else + print_table_row "$(basename "${match}")" "$arch" "$res" "UNALIGNED" "$is_critical" + unaligned_libs+=("${match}") + + if [[ "$is_critical" == "true" ]]; then + critical_unaligned_libs+=("${match}") + else + non_critical_unaligned_libs+=("${match}") + fi + fi +done + +print_table_footer + +# Enhanced Summary Section +if [ ${#unaligned_libs[@]} -gt 0 ]; then + # Failure case - unaligned libraries found + summary_lines=( + "${ALERT} ACTION REQUIRED: Unaligned native libraries detected!" + "" + "Analysis Results:" + " • Total libraries scanned: $total_libs" + " • Critical architectures (64-bit): $critical_libs" + " • Libraries aligned: ${#aligned_libs[@]}" + " • Libraries UNALIGNED: ${#unaligned_libs[@]}" + ) + + if [ ${#critical_unaligned_libs[@]} -gt 0 ]; then + summary_lines+=(" • Critical failures: ${#critical_unaligned_libs[@]} (MUST FIX)") + fi + + if [ ${#non_critical_unaligned_libs[@]} -gt 0 ]; then + summary_lines+=(" • Non-critical warnings: ${#non_critical_unaligned_libs[@]} (SHOULD FIX)") + fi + + summary_lines+=("") + summary_lines+=("Google Play Compliance: FAILED") + summary_lines+=("Deadline: November 1st, 2025") + + print_summary_box "COMPATIBILITY CHECK FAILED" "error" "${summary_lines[@]}" + + # Detailed library breakdown + if [ ${#critical_unaligned_libs[@]} -gt 0 ]; then + print_subsection "Critical Libraries Requiring Immediate Attention" + for lib in "${critical_unaligned_libs[@]}"; do + arch_type="64-bit" + [[ "${lib}" == *"arm64-v8a"* ]] && arch_type="ARM64" + [[ "${lib}" == *"x86_64"* ]] && arch_type="x86_64" + print_status "error" "$(basename "$lib")" "$arch_type architecture - Required for Google Play" + done + fi + + if [ ${#non_critical_unaligned_libs[@]} -gt 0 ]; then + print_subsection "Non-Critical Libraries (Recommended to Fix)" + for lib in "${non_critical_unaligned_libs[@]}"; do + arch_type="32-bit" + [[ "${lib}" == *"armeabi-v7a"* ]] && arch_type="ARMv7" + [[ "${lib}" == *"x86"* ]] && arch_type="x86" + print_status "warning" "$(basename "$lib")" "$arch_type architecture" + done + fi + + # Comprehensive fix instructions + print_section "$TOOLS" "How to Fix Unaligned Libraries" "Step-by-step guide to achieve 16KB compatibility" + + print_subsection "Step 1: Update Your Build Environment" + print_status "info" "Android Gradle Plugin (AGP)" "Upgrade to version 8.5.1 or higher" + print_status "info" "Android NDK" "Update to NDK r27 or higher (r28+ recommended)" + print_status "info" "Build Tools" "Ensure Android SDK build-tools 35.0.0+ for zipalign" + + print_subsection "Step 2: Configure 16KB ELF Alignment" + echo + echo -e "${BOLD}For NDK r28 and newer:${ENDCOLOR}" + print_status "success" "Automatic Support" "16KB alignment enabled by default - no changes needed!" + + echo + echo -e "${BOLD}For NDK r27:${ENDCOLOR}" + print_status "info" "Gradle Configuration" "Add to your app/build.gradle:" + echo -e "${DIM} android {" + echo -e " defaultConfig {" + echo -e " externalNativeBuild {" + echo -e " cmake {" + echo -e " arguments '-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON'" + echo -e " }" + echo -e " }" + echo -e " }" + echo -e " }${ENDCOLOR}" + + print_status "info" "NDK-Build Configuration" "Add to Application.mk:" + echo -e "${DIM} APP_SUPPORT_FLEXIBLE_PAGE_SIZES := true${ENDCOLOR}" + + echo + echo -e "${BOLD}For NDK r26 and older:${ENDCOLOR}" + print_status "info" "Manual Linker Flags" "Add to your native build configuration:" + echo -e "${DIM} # For Android.mk:" + echo -e " LOCAL_LDFLAGS += \"-Wl,-z,max-page-size=16384\"" + echo + echo -e " # For CMakeLists.txt:" + echo -e " target_link_options(\${CMAKE_PROJECT_NAME} PRIVATE \"-Wl,-z,max-page-size=16384\")${ENDCOLOR}" + + print_subsection "Step 3: Update Library Packaging" + print_status "info" "AGP 8.5.1+" "Uncompressed libraries used by default (no changes needed)" + print_status "info" "Older AGP versions" "Add to app/build.gradle:" + echo -e "${DIM} android {" + echo -e " packagingOptions {" + echo -e " jniLibs {" + echo -e " useLegacyPackaging = true" + echo -e " }" + echo -e " }" + echo -e " }${ENDCOLOR}" + + print_subsection "Step 4: Build and Verify" + print_status "processing" "Clean Build" "Run ./gradlew clean" + print_status "processing" "Rebuild Project" "Run ./gradlew assembleRelease" + print_status "processing" "Re-run This Script" "Verify all libraries are now aligned" + print_status "processing" "Test on Device" "Use Android 15 emulator with 16KB system image" + + print_section "$BOOKS" "Additional Resources" "Learn more about 16KB page size support" + print_status "info" "Official Guide" "https://developer.android.com/guide/practices/page-sizes" + print_status "info" "NDK Documentation" "https://developer.android.com/ndk/guides/" + print_status "info" "Testing Guide" "Use 'adb shell getconf PAGE_SIZE' (should return 16384)" + print_status "info" "Emulator Setup" "Android 15 system images with 16KB page size" + + final_message="" + if [ ${#critical_unaligned_libs[@]} -gt 0 ]; then + final_message="CRITICAL: Fix required for Google Play compliance by November 1st, 2025!" + else + final_message="Warning: Non-critical issues found - recommended to fix for complete compatibility" + fi + + print_summary_box "NEXT STEPS" "error" \ + "$final_message" \ + "" \ + "1. Update your build tools and NDK version" \ + "2. Apply the configuration changes above" \ + "3. Clean and rebuild your project" \ + "4. Run this script again to verify fixes" \ + "5. Test thoroughly on 16KB devices/emulator" + + cleanup_trap 1 +else + # Success case - all libraries aligned + summary_lines=( + "${PARTY} All native libraries are properly aligned!" + "" + "Analysis Results:" + " • Total libraries scanned: $total_libs" + " • Critical architectures: $critical_libs" + " • All libraries: ${#aligned_libs[@]}/${total_libs} ALIGNED" + "" + "Google Play Compliance: PASSED ${CHECK_MARK}" + "Ready for November 1st, 2025 deadline!" + ) + + print_summary_box "COMPATIBILITY CHECK PASSED" "success" "${summary_lines[@]}" + + print_section "$ROCKET" "Next Steps" "Ensure complete 16KB compatibility" + + print_status "success" "Library Alignment" "All ELF segments properly aligned for 16KB pages" + print_status "info" "Runtime Testing" "Test on Android 15 emulator with 16KB system image" + print_status "info" "Code Review" "Check for hardcoded PAGE_SIZE dependencies in your code" + print_status "info" "Third-party SDKs" "Verify all dependencies are 16KB compatible" + print_status "info" "Zipalign Verification" "Run: zipalign -c -P 16 -v 4 your-app.apk" + + print_subsection "Testing Commands" + echo -e "${DIM} # Verify page size on device/emulator${ENDCOLOR}" + echo -e "${DIM} adb shell getconf PAGE_SIZE # Should return: 16384${ENDCOLOR}" + echo + echo -e "${DIM} # Verify APK alignment${ENDCOLOR}" + echo -e "${DIM} zipalign -c -P 16 -v 4 app-release.apk${ENDCOLOR}" + + print_summary_box "CONGRATULATIONS!" "success" \ + "${PARTY} Your app is 16KB page size compatible!" \ + "" \ + "${CHECK_MARK} All native libraries meet Google Play requirements" \ + "${CHECK_MARK} Ready for devices with 16KB page sizes" \ + "${CHECK_MARK} Compliant with November 1st, 2025 deadline" \ + "" \ + "Recommendation: Test thoroughly on 16KB environment to ensure" \ + "no runtime issues exist in your application code." +fi + +echo +print_status "info" "Analysis completed at $(date)" +echo diff --git a/src/serious_python_android/src/CMakeLists.txt b/src/serious_python_android/src/CMakeLists.txt index 2d52ffcd..c2800814 100644 --- a/src/serious_python_android/src/CMakeLists.txt +++ b/src/serious_python_android/src/CMakeLists.txt @@ -14,4 +14,11 @@ set_target_properties(serious_python PROPERTIES OUTPUT_NAME "serious_python" ) +# Add 16 KB page size support for Android 15 +if(ANDROID) + set_target_properties(serious_python PROPERTIES + LINK_FLAGS "-Wl,-z,max-page-size=16384" + ) +endif() + target_compile_definitions(serious_python PUBLIC DART_SHARED_LIB) From 92e76d076e83462ae9b4d6c42eef0bf3a215ebbb Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Mon, 20 Oct 2025 09:39:24 -0700 Subject: [PATCH 21/49] Bump version to 0.9.4 --- src/serious_python/CHANGELOG.md | 4 ++++ src/serious_python/pubspec.yaml | 2 +- src/serious_python_android/CHANGELOG.md | 4 ++++ src/serious_python_android/android/build.gradle | 2 +- src/serious_python_android/pubspec.yaml | 2 +- src/serious_python_darwin/CHANGELOG.md | 4 ++++ .../darwin/serious_python_darwin.podspec | 2 +- src/serious_python_darwin/pubspec.yaml | 2 +- src/serious_python_linux/CHANGELOG.md | 4 ++++ src/serious_python_linux/pubspec.yaml | 2 +- src/serious_python_platform_interface/CHANGELOG.md | 4 ++++ src/serious_python_platform_interface/pubspec.yaml | 2 +- src/serious_python_windows/CHANGELOG.md | 4 ++++ src/serious_python_windows/pubspec.yaml | 2 +- 14 files changed, 32 insertions(+), 8 deletions(-) diff --git a/src/serious_python/CHANGELOG.md b/src/serious_python/CHANGELOG.md index c6a429d9..614940aa 100644 --- a/src/serious_python/CHANGELOG.md +++ b/src/serious_python/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.9.4 + +* 16 KB memory page support for Android 15+ (by [@ReYaNOW](https://github.com/ReYaNOW)). + ## 0.9.3 * Fix: Hidden files in site-packages are skipped when building macOS app. diff --git a/src/serious_python/pubspec.yaml b/src/serious_python/pubspec.yaml index 2684f173..732cee5f 100644 --- a/src/serious_python/pubspec.yaml +++ b/src/serious_python/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python description: A cross-platform plugin for adding embedded Python runtime to your Flutter apps. homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 0.9.3 +version: 0.9.4 platforms: ios: diff --git a/src/serious_python_android/CHANGELOG.md b/src/serious_python_android/CHANGELOG.md index 075ab98c..658f9f8d 100644 --- a/src/serious_python_android/CHANGELOG.md +++ b/src/serious_python_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.9.4 + +* 16 KB memory page support for Android 15+ (by [@ReYaNOW](https://github.com/ReYaNOW)). + ## 0.9.3 * Fix: Hidden files in site-packages are skipped when building macOS app. diff --git a/src/serious_python_android/android/build.gradle b/src/serious_python_android/android/build.gradle index 52c5bb08..1c38c434 100644 --- a/src/serious_python_android/android/build.gradle +++ b/src/serious_python_android/android/build.gradle @@ -1,5 +1,5 @@ group 'com.flet.serious_python_android' -version '0.9.3' +version '0.9.4' def python_version = '3.12' diff --git a/src/serious_python_android/pubspec.yaml b/src/serious_python_android/pubspec.yaml index e668e498..90adfe9c 100644 --- a/src/serious_python_android/pubspec.yaml +++ b/src/serious_python_android/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_android description: Android implementation of the serious_python plugin homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 0.9.3 +version: 0.9.4 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/src/serious_python_darwin/CHANGELOG.md b/src/serious_python_darwin/CHANGELOG.md index 07cd93da..330b8328 100644 --- a/src/serious_python_darwin/CHANGELOG.md +++ b/src/serious_python_darwin/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.9.4 + +* 16 KB memory page support for Android 15+ (by [@ReYaNOW](https://github.com/ReYaNOW)). + ## 0.9.3 * Fix: Hidden files in site-packages are skipped when building macOS app. diff --git a/src/serious_python_darwin/darwin/serious_python_darwin.podspec b/src/serious_python_darwin/darwin/serious_python_darwin.podspec index c73af73d..05f0de51 100644 --- a/src/serious_python_darwin/darwin/serious_python_darwin.podspec +++ b/src/serious_python_darwin/darwin/serious_python_darwin.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'serious_python_darwin' - s.version = '0.9.3' + s.version = '0.9.4' s.summary = 'A cross-platform plugin for adding embedded Python runtime to your Flutter apps.' s.description = <<-DESC A cross-platform plugin for adding embedded Python runtime to your Flutter apps. diff --git a/src/serious_python_darwin/pubspec.yaml b/src/serious_python_darwin/pubspec.yaml index 1afc3908..655f04c3 100644 --- a/src/serious_python_darwin/pubspec.yaml +++ b/src/serious_python_darwin/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_darwin description: iOS and macOS implementations of the serious_python plugin homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 0.9.3 +version: 0.9.4 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/src/serious_python_linux/CHANGELOG.md b/src/serious_python_linux/CHANGELOG.md index e4e42b45..0f06bba1 100644 --- a/src/serious_python_linux/CHANGELOG.md +++ b/src/serious_python_linux/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.9.4 + +* 16 KB memory page support for Android 15+ (by [@ReYaNOW](https://github.com/ReYaNOW)). + ## 0.9.3 * Fix: Hidden files in site-packages are skipped when building macOS app. diff --git a/src/serious_python_linux/pubspec.yaml b/src/serious_python_linux/pubspec.yaml index f26b2c20..b2b22e82 100644 --- a/src/serious_python_linux/pubspec.yaml +++ b/src/serious_python_linux/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_linux description: Linux implementations of the serious_python plugin homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 0.9.3 +version: 0.9.4 environment: sdk: '>=3.1.3 <4.0.0' diff --git a/src/serious_python_platform_interface/CHANGELOG.md b/src/serious_python_platform_interface/CHANGELOG.md index c66601dd..bb1ffc8f 100644 --- a/src/serious_python_platform_interface/CHANGELOG.md +++ b/src/serious_python_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.9.4 + +* 16 KB memory page support for Android 15+ (by [@ReYaNOW](https://github.com/ReYaNOW)). + ## 0.9.3 * Fix: Hidden files in site-packages are skipped when building macOS app. diff --git a/src/serious_python_platform_interface/pubspec.yaml b/src/serious_python_platform_interface/pubspec.yaml index 8e892462..a5428de2 100644 --- a/src/serious_python_platform_interface/pubspec.yaml +++ b/src/serious_python_platform_interface/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_platform_interface description: A common platform interface for the serious_python plugin. homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 0.9.3 +version: 0.9.4 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/src/serious_python_windows/CHANGELOG.md b/src/serious_python_windows/CHANGELOG.md index 64dde934..a29364f5 100644 --- a/src/serious_python_windows/CHANGELOG.md +++ b/src/serious_python_windows/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.9.4 + +* 16 KB memory page support for Android 15+ (by [@ReYaNOW](https://github.com/ReYaNOW)). + ## 0.9.3 * Fix: Hidden files in site-packages are skipped when building macOS app. diff --git a/src/serious_python_windows/pubspec.yaml b/src/serious_python_windows/pubspec.yaml index 9042d100..823f9799 100644 --- a/src/serious_python_windows/pubspec.yaml +++ b/src/serious_python_windows/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_windows description: Windows implementations of the serious_python plugin homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 0.9.3 +version: 0.9.4 environment: sdk: '>=3.1.3 <4.0.0' From 41c8c51db18329986a525dcf0e12143208ecdbf8 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Mon, 20 Oct 2025 10:39:53 -0700 Subject: [PATCH 22/49] Increase minSdkVersion to 21 in build.gradle Updated the Android project's minimum SDK version from 16 to 21 to ensure compatibility with newer APIs and libraries. --- src/serious_python_android/android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/serious_python_android/android/build.gradle b/src/serious_python_android/android/build.gradle index 1c38c434..35d43607 100644 --- a/src/serious_python_android/android/build.gradle +++ b/src/serious_python_android/android/build.gradle @@ -54,7 +54,7 @@ android { } defaultConfig { - minSdkVersion 16 + minSdkVersion 21 ndk { abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64' From 9a7c8d2772242ae17c1418572262283ed3826e64 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Mon, 20 Oct 2025 11:02:44 -0700 Subject: [PATCH 23/49] Switch flet dependency to Git source Changed the flet package source from a versioned release to a Git repository reference, pointing to the main branch of the official flet-dev/flet repository. This allows for using the latest code from the repository. --- src/serious_python/example/flet_example/pubspec.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/serious_python/example/flet_example/pubspec.yaml b/src/serious_python/example/flet_example/pubspec.yaml index f8e5e4ee..f33f16fa 100644 --- a/src/serious_python/example/flet_example/pubspec.yaml +++ b/src/serious_python/example/flet_example/pubspec.yaml @@ -35,7 +35,11 @@ dependencies: serious_python: path: ../../ - flet: ^0.26.0 + flet: + git: + path: packages/flet + ref: main + url: https://github.com/flet-dev/flet.git path: ^1.8.3 url_strategy: ^0.2.0 From b299db5a6d8690f0be924b742b5b48098ec39c03 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Mon, 20 Oct 2025 11:26:24 -0700 Subject: [PATCH 24/49] Remove --pre flag from serious_python packaging commands The --pre flag was removed from all dart run serious_python:main package commands in the CI workflow for all platforms. This change likely reflects an update in the packaging process or a move away from using pre-release features. --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3bbded9a..0e8e8c5c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: shell: bash working-directory: "src/serious_python/example/flet_example" run: | - dart run serious_python:main package app/src -p Darwin -r flet -r --pre + dart run serious_python:main package app/src -p Darwin -r flet flutter test integration_test --device-id macos ios: @@ -68,7 +68,7 @@ jobs: working-directory: "src/serious_python/example/flet_example" run: | flutter devices - dart run serious_python:main package app/src -p iOS -r flet -r --pre + dart run serious_python:main package app/src -p iOS -r flet flutter build ios --no-codesign android: @@ -119,7 +119,7 @@ jobs: pre-emulator-launch-script: | sdkmanager --list_installed script: | - cd src/serious_python/example/flet_example && dart run serious_python:main package app/src -p Android -r flet -r --pre + cd src/serious_python/example/flet_example && dart run serious_python:main package app/src -p Android -r flet cd src/serious_python/example/flet_example && flutter test integration_test --device-id emulator-5554 windows: @@ -139,7 +139,7 @@ jobs: shell: bash working-directory: "src/serious_python/example/flet_example" run: | - dart run serious_python:main package app/src -p Windows -r flet -r --pre + dart run serious_python:main package app/src -p Windows -r flet flutter test integration_test -d windows linux: @@ -181,7 +181,7 @@ jobs: shell: bash working-directory: "src/serious_python/example/flet_example" run: | - dart run serious_python:main package app/src -p Linux -r flet -r --pre + dart run serious_python:main package app/src -p Linux -r flet xvfb-run flutter test integration_test -d linux linux-arm64: @@ -215,7 +215,7 @@ jobs: shell: bash working-directory: "src/serious_python/example/flet_example" run: | - dart run serious_python:main package app/src -p Linux -r flet -r --pre + dart run serious_python:main package app/src -p Linux -r flet xvfb-run flutter test integration_test -d linux publish: From 5cc415f418dda21f01e872fc3f32f25bda5bc7d8 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Mon, 20 Oct 2025 11:44:10 -0700 Subject: [PATCH 25/49] Update iOS CI workflow to run integration tests Replaces the iOS build step with a Flutter integration test run using the simulator's UDID. Adds a step to display the simulator UDID and ensures dependencies are fetched for Linux tests. --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e8e8c5c..be466304 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,19 +57,23 @@ jobs: cache: true - name: Launch iOS Simulator + id: ios-sim uses: futureware-tech/simulator-action@v4 with: model: 'iPhone 16' shutdown_after_job: true wait_for_boot: true + - name: Show simulator UDID + run: echo "Simulator UDID is ${{ steps.ios-sim.outputs.udid }}" + - name: Build iOS shell: bash working-directory: "src/serious_python/example/flet_example" run: | flutter devices dart run serious_python:main package app/src -p iOS -r flet - flutter build ios --no-codesign + flutter drive -d ${{ steps.ios-sim.outputs.udid }} --driver=test_driver/integration_test.dart --target=integration_test/app_test.dart android: name: Test on Android @@ -215,6 +219,7 @@ jobs: shell: bash working-directory: "src/serious_python/example/flet_example" run: | + flutter pub get dart run serious_python:main package app/src -p Linux -r flet xvfb-run flutter test integration_test -d linux From db11902dbb3981322088eecc83686c9fdda47d4d Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Mon, 20 Oct 2025 12:09:21 -0700 Subject: [PATCH 26/49] Update CI workflow: add uv setup and streamline steps Adds a step to set up uv using astral-sh/setup-uv, removes the explicit apt-get update, and consolidates the iOS build and test steps. Also removes the simulator UDID output step for a cleaner workflow. --- .github/workflows/ci.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be466304..90432808 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,10 +64,7 @@ jobs: shutdown_after_job: true wait_for_boot: true - - name: Show simulator UDID - run: echo "Simulator UDID is ${{ steps.ios-sim.outputs.udid }}" - - - name: Build iOS + - name: Run tests shell: bash working-directory: "src/serious_python/example/flet_example" run: | @@ -241,6 +238,9 @@ jobs: with: fetch-depth: 0 + - name: Setup uv + uses: astral-sh/setup-uv@v6 + - name: Setup Flutter uses: kuhnroyal/flutter-fvm-config-action/setup@v3 with: @@ -253,7 +253,6 @@ jobs: run: | PKG_VER="${GITHUB_REF_NAME#v}" echo "PKG_VER=$PKG_VER" | tee -a "$GITHUB_ENV" - sudo apt-get update - name: Configure pub.dev credentials # if: ${{ secrets.PUB_DEV_TOKEN != '' }} From 62926713c5c8f3a36e5781b2e16d06aa5a02fd04 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Mon, 20 Oct 2025 12:34:30 -0700 Subject: [PATCH 27/49] Remove flutter devices step from CI workflow Eliminates the redundant 'flutter devices' command from the CI job for the Flet example, streamlining the workflow. --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 90432808..ee358278 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,7 +68,6 @@ jobs: shell: bash working-directory: "src/serious_python/example/flet_example" run: | - flutter devices dart run serious_python:main package app/src -p iOS -r flet flutter drive -d ${{ steps.ios-sim.outputs.udid }} --driver=test_driver/integration_test.dart --target=integration_test/app_test.dart From a00d42c18f1a69f379b0b0ea84328b38fe2a0432 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Mon, 20 Oct 2025 12:34:59 -0700 Subject: [PATCH 28/49] Remove --force flag from Dart publish step The --force flag was removed from the 'dart pub publish --dry-run' command in the CI workflow. This change ensures the publish step adheres to standard dry-run behavior without forcing publication. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee358278..3a1a3f12 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -280,7 +280,7 @@ jobs: run: | publish_pkg () { pushd "$1" >/dev/null - dart pub publish --force --dry-run + dart pub publish --dry-run popd >/dev/null } From f5194ccf308506546e7afe7113d05f01d2632a19 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Mon, 20 Oct 2025 12:38:27 -0700 Subject: [PATCH 29/49] Add caching for Android SDK in CI workflow Introduces a cache step for Android SDK components in the GitHub Actions CI workflow to improve build performance and reduce setup time. --- .github/workflows/ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a1a3f12..482923be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,6 +102,19 @@ jobs: ~/.android/adb* key: avd + - name: Cache Android SDK + uses: actions/cache@v4 + with: + path: | + /usr/local/lib/android/sdk/ndk + /usr/local/lib/android/sdk/cmake + /usr/local/lib/android/sdk/build-tools + /usr/local/lib/android/sdk/platforms + /usr/local/lib/android/sdk/platform-tools + /usr/local/lib/android/sdk/system-images + key: android-sdk-${{ runner.os }}-api33-ndk25.1 + restore-keys: android-sdk-${{ runner.os }}-api33-ndk25.1 + - name: Run Android Emulator uses: reactivecircus/android-emulator-runner@v2 with: From a609ebdea424480c3e3d6d4ee80dc01c1f6f96a4 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Mon, 20 Oct 2025 13:30:51 -0700 Subject: [PATCH 30/49] Remove Android SDK cache step from CI workflow The step for caching the Android SDK directories has been removed from the GitHub Actions CI workflow. This may help avoid cache-related issues or reduce workflow complexity. --- .github/workflows/ci.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 482923be..3a1a3f12 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,19 +102,6 @@ jobs: ~/.android/adb* key: avd - - name: Cache Android SDK - uses: actions/cache@v4 - with: - path: | - /usr/local/lib/android/sdk/ndk - /usr/local/lib/android/sdk/cmake - /usr/local/lib/android/sdk/build-tools - /usr/local/lib/android/sdk/platforms - /usr/local/lib/android/sdk/platform-tools - /usr/local/lib/android/sdk/system-images - key: android-sdk-${{ runner.os }}-api33-ndk25.1 - restore-keys: android-sdk-${{ runner.os }}-api33-ndk25.1 - - name: Run Android Emulator uses: reactivecircus/android-emulator-runner@v2 with: From a5528c4aca2b1bc076a6e6ef508d16707a1ac226 Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Tue, 21 Oct 2025 02:42:46 +0200 Subject: [PATCH 31/49] updates --- .github/workflows/ci.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a1a3f12..e0dc5d48 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: shell: bash working-directory: "src/serious_python/example/flet_example" run: | - dart run serious_python:main package app/src -p Darwin -r flet + dart run serious_python:main package app/src --platform Darwin --requirements flet flutter test integration_test --device-id macos ios: @@ -56,11 +56,11 @@ jobs: path: '.fvmrc' cache: true - - name: Launch iOS Simulator - id: ios-sim + - name: Setup iOS Simulator + id: simulator uses: futureware-tech/simulator-action@v4 with: - model: 'iPhone 16' + model: 'iPhone 16 Pro Max' shutdown_after_job: true wait_for_boot: true @@ -68,8 +68,8 @@ jobs: shell: bash working-directory: "src/serious_python/example/flet_example" run: | - dart run serious_python:main package app/src -p iOS -r flet - flutter drive -d ${{ steps.ios-sim.outputs.udid }} --driver=test_driver/integration_test.dart --target=integration_test/app_test.dart + dart run serious_python:main package app/src --platform iOS --requirements flet + flutter drive --device-id ${{ steps.simulator.outputs.udid }} --driver=test_driver/integration_test.dart --target=integration_test/app_test.dart android: name: Test on Android @@ -102,7 +102,7 @@ jobs: ~/.android/adb* key: avd - - name: Run Android Emulator + - name: Setup Android Emulator + Run tests uses: reactivecircus/android-emulator-runner@v2 with: avd-name: android_emulator @@ -119,7 +119,7 @@ jobs: pre-emulator-launch-script: | sdkmanager --list_installed script: | - cd src/serious_python/example/flet_example && dart run serious_python:main package app/src -p Android -r flet + cd src/serious_python/example/flet_example && dart run serious_python:main package app/src --platform Android --requirements flet cd src/serious_python/example/flet_example && flutter test integration_test --device-id emulator-5554 windows: @@ -139,7 +139,7 @@ jobs: shell: bash working-directory: "src/serious_python/example/flet_example" run: | - dart run serious_python:main package app/src -p Windows -r flet + dart run serious_python:main package app/src --platform Windows --requirements flet flutter test integration_test -d windows linux: @@ -181,7 +181,7 @@ jobs: shell: bash working-directory: "src/serious_python/example/flet_example" run: | - dart run serious_python:main package app/src -p Linux -r flet + dart run serious_python:main package app/src --platform Linux --requirements flet xvfb-run flutter test integration_test -d linux linux-arm64: @@ -216,7 +216,7 @@ jobs: working-directory: "src/serious_python/example/flet_example" run: | flutter pub get - dart run serious_python:main package app/src -p Linux -r flet + dart run serious_python:main package app/src --platform Linux --requirements flet xvfb-run flutter test integration_test -d linux publish: From 74078d614dd949d5e5af6d4af308caa8a406bddc Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Tue, 21 Oct 2025 02:56:57 +0200 Subject: [PATCH 32/49] ci: enhance Linux build configuration with architecture-specific dependencies --- .github/workflows/ci.yml | 123 +++++++++++++++++++-------------------- 1 file changed, 60 insertions(+), 63 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0dc5d48..175e6598 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -143,53 +143,24 @@ jobs: flutter test integration_test -d windows linux: - name: Test on Linux - runs-on: ubuntu-24.04 + name: Build Flet Client for Linux ${{ matrix.title }} + runs-on: ${{ matrix.runner }} + strategy: + fail-fast: false + matrix: + include: + - arch: arm64 + runner: ubuntu-24.04-arm + title: ARM64 + - arch: amd64 + runner: ubuntu-24.04 + title: AMD64 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: Install desktop deps - run: | - sudo apt-get update --allow-releaseinfo-change - sudo apt-get install -y \ - xvfb \ - libgtk-3-dev \ - libgstreamer1.0-dev \ - libgstreamer-plugins-base1.0-dev \ - libgstreamer-plugins-bad1.0-dev \ - gstreamer1.0-plugins-base \ - gstreamer1.0-plugins-good \ - gstreamer1.0-plugins-bad \ - gstreamer1.0-plugins-ugly \ - gstreamer1.0-libav \ - gstreamer1.0-tools \ - gstreamer1.0-x \ - gstreamer1.0-alsa \ - gstreamer1.0-gl \ - gstreamer1.0-gtk3 \ - gstreamer1.0-qt5 \ - gstreamer1.0-pulseaudio - - - name: Run tests - shell: bash - working-directory: "src/serious_python/example/flet_example" - run: | - dart run serious_python:main package app/src --platform Linux --requirements flet - xvfb-run flutter test integration_test -d linux - - linux-arm64: - name: Test on Linux ARM64 - runs-on: ubuntu-24.04-arm - steps: - - name: Checkout repository - uses: actions/checkout@v4 + - name: Setup uv + uses: astral-sh/setup-uv@v6 - name: Get Flutter version from ".fvmrc" uses: kuhnroyal/flutter-fvm-config-action/config@v3 @@ -201,21 +172,45 @@ jobs: uses: subosito/flutter-action@v2 with: flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }} - channel: 'master' # https://github.com/subosito/flutter-action/issues/345#issuecomment-2657332687 + channel: ${{ matrix.arch == 'arm64' && 'master' || 'stable' }} # https://github.com/subosito/flutter-action/issues/345#issuecomment-2657332687 cache: true - - name: Install deps + - name: Install dependencies shell: bash run: | - # sudo sed -i "/#\$nrconf{restart} = 'i';/s/.*/\$nrconf{restart} = 'a';/" /etc/needrestart/needrestart.conf - sudo apt-get update -y --allow-releaseinfo-change - sudo apt-get install -y clang ninja-build xvfb libgtk-3-dev gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav + sudo apt-get update --allow-releaseinfo-change + sudo apt-get install -y xvfb libgtk-3-dev + + if [ "${{ matrix.arch }}" = "amd64" ]; then + sudo apt-get install -y \ + libgstreamer1.0-dev \ + libgstreamer-plugins-base1.0-dev \ + libgstreamer-plugins-bad1.0-dev \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad \ + gstreamer1.0-plugins-ugly \ + gstreamer1.0-libav \ + gstreamer1.0-tools \ + gstreamer1.0-x \ + gstreamer1.0-alsa \ + gstreamer1.0-gl \ + gstreamer1.0-gtk3 \ + gstreamer1.0-qt5 \ + gstreamer1.0-pulseaudio + else + sudo apt-get install -y \ + clang \ + ninja-build \ + gstreamer1.0-plugins-bad \ + gstreamer1.0-plugins-ugly \ + gstreamer1.0-libav + fi - name: Run tests shell: bash - working-directory: "src/serious_python/example/flet_example" + working-directory: src/serious_python/example/flet_example run: | - flutter pub get dart run serious_python:main package app/src --platform Linux --requirements flet xvfb-run flutter test integration_test -d linux @@ -227,7 +222,6 @@ jobs: - android - windows - linux - - linux-arm64 runs-on: ubuntu-22.04 # if: startsWith(github.ref, 'refs/tags/v') steps: @@ -272,23 +266,26 @@ jobs: "serious_python_darwin" \ "serious_python_windows" \ "serious_python_linux"; do + uv run "$SCRIPTS/patch_pubspec.py" "$pkg/pubspec.yaml" "$PKG_VER" + pushd "$pkg" >/dev/null + dart pub publish --dry-run + popd >/dev/null done - name: Publish packages shell: bash + working-directory: "src" run: | - publish_pkg () { - pushd "$1" >/dev/null + for pkg in \ + "serious_python_platform_interface" \ + "serious_python_android" \ + "serious_python_darwin" \ + "serious_python_windows" \ + "serious_python_linux" \ + "serious_python"; do + + pushd "$pkg" >/dev/null dart pub publish --dry-run popd >/dev/null - } - - publish_pkg src/serious_python_platform_interface - sleep 600 - publish_pkg src/serious_python_android - publish_pkg src/serious_python_darwin - publish_pkg src/serious_python_windows - publish_pkg src/serious_python_linux - sleep 600 - publish_pkg src/serious_python \ No newline at end of file + done \ No newline at end of file From 23192badbdb0990b821356eb0e591c858713ecc1 Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Tue, 21 Oct 2025 03:13:33 +0200 Subject: [PATCH 33/49] ci: update macOS and iOS jobs to use latest runner and improve test commands --- .github/workflows/ci.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 175e6598..45ceea9c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ env: jobs: macos: name: Test on macOS - runs-on: macos-15 + runs-on: macos-latest steps: - name: Checkout repository uses: actions/checkout@v4 @@ -45,7 +45,7 @@ jobs: ios: name: Test on iOS - runs-on: macos-15 + runs-on: macos-latest steps: - name: Checkout repository uses: actions/checkout@v4 @@ -60,7 +60,10 @@ jobs: id: simulator uses: futureware-tech/simulator-action@v4 with: + # https://github.com/futureware-tech/simulator-action/wiki/Devices-macos-latest model: 'iPhone 16 Pro Max' + os: "iOS" + os_version: "^18.6" shutdown_after_job: true wait_for_boot: true @@ -69,7 +72,7 @@ jobs: working-directory: "src/serious_python/example/flet_example" run: | dart run serious_python:main package app/src --platform iOS --requirements flet - flutter drive --device-id ${{ steps.simulator.outputs.udid }} --driver=test_driver/integration_test.dart --target=integration_test/app_test.dart + flutter test integration_test --device-id ${{ steps.simulator.outputs.udid }} android: name: Test on Android @@ -143,7 +146,7 @@ jobs: flutter test integration_test -d windows linux: - name: Build Flet Client for Linux ${{ matrix.title }} + name: Test on Linux ${{ matrix.title }} runs-on: ${{ matrix.runner }} strategy: fail-fast: false From 067a98fa977abea12d00fdd33c71be5b70eb479f Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Tue, 21 Oct 2025 03:29:47 +0200 Subject: [PATCH 34/49] ci: update version computation logic in CI workflow --- .github/workflows/ci.yml | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 45ceea9c..f3e7b9d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,12 +9,10 @@ on: pull_request: workflow_dispatch: -permissions: - contents: write -concurrency: - group: ci-${{ github.workflow }}-${{ github.event.pull_request.head.ref || github.ref_name }} - cancel-in-progress: true +#concurrency: +# group: ci-${{ github.workflow }}-${{ github.event.pull_request.head.ref || github.ref_name }} +# cancel-in-progress: true env: ROOT: "${{ github.workspace }}" @@ -244,10 +242,29 @@ jobs: cache: true - name: Compute PKG_VER - id: ver shell: bash run: | - PKG_VER="${GITHUB_REF_NAME#v}" + if [[ "$GITHUB_REF" == refs/tags/* ]]; then + # Extract the tag name + tag="${GITHUB_REF#refs/tags/}" + + # Remove leading "v" if present + PKG_VER="${tag#v}" + else + # Get the latest tag, or fall back to "v0.0.0" if none exist + cv=$(git describe --abbrev=0 2>/dev/null || echo "v0.0.0") + # Remove leading "v" if present + cv=${cv#v} + + # Split into major/minor components + major=$(echo "$cv" | cut -d. -f1) + minor=$(echo "$cv" | cut -d. -f2) + + # Construct the package version: ..0 + PKG_VER="${major}.${minor}.${GITHUB_RUN_NUMBER}" + fi + + export PKG_VER echo "PKG_VER=$PKG_VER" | tee -a "$GITHUB_ENV" - name: Configure pub.dev credentials From b1d8ccf3fdfbddf6f34acc3735145a3ec4d8d464 Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Tue, 21 Oct 2025 03:30:13 +0200 Subject: [PATCH 35/49] ci: remove dry-run step from package publishing --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f3e7b9d0..cc53b559 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -288,9 +288,6 @@ jobs: "serious_python_linux"; do uv run "$SCRIPTS/patch_pubspec.py" "$pkg/pubspec.yaml" "$PKG_VER" - pushd "$pkg" >/dev/null - dart pub publish --dry-run - popd >/dev/null done - name: Publish packages From cdb469057b154884160f3754f40f6ac7af0a6078 Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Tue, 21 Oct 2025 03:56:43 +0200 Subject: [PATCH 36/49] ci: use environment variable for emulator port in CI workflow --- .github/workflows/ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc53b559..e4d72cd2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,6 +105,8 @@ jobs: - name: Setup Android Emulator + Run tests uses: reactivecircus/android-emulator-runner@v2 + env: + EMULATOR_PORT: 5554 with: avd-name: android_emulator api-level: 33 @@ -114,14 +116,14 @@ jobs: sdcard-path-or-size: 128M ram-size: 2048M disk-size: 4096M - emulator-port: 5554 + emulator-port: ${{ env.EMULATOR_PORT }} disable-animations: true - emulator-options: -no-window -noaudio -no-boot-anim -memory 2048 -wipe-data -cache-size 1000 -partition-size 8192 + 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/flet_example && dart run serious_python:main package app/src --platform Android --requirements flet - cd src/serious_python/example/flet_example && flutter test integration_test --device-id emulator-5554 + cd src/serious_python/example/flet_example && flutter test integration_test --device-id emulator-${{ env.EMULATOR_PORT }} windows: name: Test on Windows From ea09aa2eba940ac49434eb2f2e69e21c5dadf64f Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Tue, 21 Oct 2025 04:44:31 +0200 Subject: [PATCH 37/49] update CI configuration for versioning and patching --- .appveyor.yml | 297 --------------------------------------- .github/workflows/ci.yml | 3 +- ci/download_artifact.py | 51 ------- ci/install_flutter.sh | 6 - ci/patch_pubspec.py | 37 ----- 5 files changed, 2 insertions(+), 392 deletions(-) delete mode 100644 .appveyor.yml delete mode 100644 ci/download_artifact.py delete mode 100755 ci/install_flutter.sh delete mode 100644 ci/patch_pubspec.py diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 0ca6c2fd..00000000 --- a/.appveyor.yml +++ /dev/null @@ -1,297 +0,0 @@ -skip_branch_with_pr: true - -environment: - FLUTTER_VERSION: 3.29.3 - GITHUB_TOKEN: - secure: 9SKIwc3VSfYJ5IChvNR74mEv2nb0ZFftUzn3sGRdXipXEfKSxY50DoodChHvlqZduQNhjg0oyLWAAa3n+iwWvVM2yI7Cgb14lFNClijz/kHI/PibnjDMNvLKaAygcfAc - - matrix: - - job_name: Test on macOS - job_group: test_serious_python - job_depends_on: build_python_darwin - APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey - - - job_name: Test on iOS - job_group: test_serious_python - job_depends_on: build_python_darwin - APPVEYOR_BUILD_WORKER_IMAGE: macos-ventura - - - job_name: Test on Android - job_group: test_serious_python - job_depends_on: build_python_android - APPVEYOR_BUILD_WORKER_IMAGE: ubuntu-gce-c - - - job_name: Test on Windows - job_group: test_serious_python - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 - - - job_name: Test on Linux - job_group: test_serious_python - APPVEYOR_BUILD_WORKER_IMAGE: ubuntu2004 - - - job_name: Test on Linux ARM64 - job_group: test_serious_python - APPVEYOR_BUILD_WORKER_IMAGE: ubuntu2204-arm - - - job_name: Publish serious_python package to pub.dev - job_group: publish_package - job_depends_on: build_python, test_serious_python - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004 - -stack: -- python 3.12 - -for: - # ====================================== - # Test on macOS - # ====================================== - - - matrix: - only: - - job_name: Test on macOS - - install: - - HOMEBREW_NO_AUTO_UPDATE=1 brew install cocoapods - - source ci/install_flutter.sh - - flutter config --enable-macos-desktop - - flutter doctor -v - - xcodebuild -version - - build: off - - test_script: - - export SERIOUS_PYTHON_SITE_PACKAGES=$APPVEYOR_BUILD_FOLDER/site-packages - - cd src/serious_python/example/flet_example - - dart run serious_python:main package app/src -p Darwin -r flet - - flutter test integration_test -d macos - - # ====================================== - # Test on iOS - # ====================================== - - - matrix: - only: - - job_name: Test on iOS - - install: - - HOMEBREW_NO_AUTO_UPDATE=1 brew install cocoapods - - source ci/install_flutter.sh - # - xcrun simctl list runtimes - # - xcrun simctl create "e2e test" "iPhone 12" "com.apple.CoreSimulator.SimRuntime.iOS-17-2" - # - xcrun xctrace list devices - # - | - # UDID=$(xcrun xctrace list devices | grep "^e2e test Simulator (17.2)" | awk '{gsub(/[()]/,""); print $NF}') - # echo $UDID - # xcrun simctl boot "${UDID:?No Simulator with this name found}" - - build: off - - test_script: - - export SERIOUS_PYTHON_SITE_PACKAGES=$APPVEYOR_BUILD_FOLDER/site-packages - - cd src/serious_python/example/flet_example - - dart run serious_python:main package app/src -p iOS -r flet - - flutter build ios --no-codesign - # - flutter drive --driver=test_driver/integration_test.dart --target=integration_test/app_test.dart - - # ====================================== - # Test on Android - # ====================================== - - - matrix: - only: - - job_name: Test on Android - - install: - - API_LEVEL="33" - - TARGET="google_atd" - - ARCH="x86_64" - - DEVICE_NAME="android_emulator" - - DEVICE_TYPE="pixel_5" - - 'export PATH=$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/emulator:$PATH' - - sdkmanager "platform-tools" "platforms;android-${API_LEVEL}" - - sdkmanager --install "system-images;android-${API_LEVEL};${TARGET};${ARCH}" - - sdkmanager --update - - echo "y" | sdkmanager --licenses - - echo "no" | avdmanager -v create avd --force --name "${DEVICE_NAME}" --package "system-images;android-${API_LEVEL};${TARGET};${ARCH}" --tag "${TARGET}" --sdcard 128M --device "${DEVICE_TYPE}" - - ls -al ~/.android/avd - - sudo adduser $USER kvm - - sudo chown $USER /dev/kvm - - emulator -avd "${DEVICE_NAME}" -memory 2048 -wipe-data -no-boot-anim -cache-size 1000 -noaudio -no-window -partition-size 8192 & - - adb wait-for-device shell 'while [[ -z $(getprop dev.bootcomplete) ]]; do sleep 1; done;' - - source ci/install_flutter.sh - - build: off - - test_script: - - export SERIOUS_PYTHON_SITE_PACKAGES=$APPVEYOR_BUILD_FOLDER/site-packages - - cd src/serious_python/example/flet_example - - dart run serious_python:main package app/src -p Android -r flet - - flutter test integration_test -d emulator-5554 - - - # ====================================== - # Test on Windows - # ====================================== - - - matrix: - only: - - job_name: Test on Windows - - #environment: - # VC_REDIST_DIR: 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.29.30133\x64\Microsoft.VC142.CRT' - - install: - - dart pub global activate fvm - - set PATH=%LOCALAPPDATA%\Pub\Cache\bin;%USERPROFILE%\fvm\default\bin;%PATH% - - fvm install %FLUTTER_VERSION% - - fvm global %FLUTTER_VERSION% - - flutter --version - - flutter doctor - - build: off - - test_script: - - set SERIOUS_PYTHON_SITE_PACKAGES=%APPVEYOR_BUILD_FOLDER%\site-packages - - cd src/serious_python/example/flet_example - - dart run serious_python:main package app/src -p Windows -r flet - - flutter test integration_test -d windows - - # ====================================== - # Test on Linux - # ====================================== - - - matrix: - only: - - job_name: Test on Linux - - install: - - sudo apt update --allow-releaseinfo-change - - sudo apt install -y xvfb libgtk-3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio - - source ci/install_flutter.sh - - build: off - - test_script: - - export SERIOUS_PYTHON_SITE_PACKAGES=$APPVEYOR_BUILD_FOLDER/site-packages - - cd src/serious_python/example/flet_example - - dart run serious_python:main package app/src -p Linux -r flet - - xvfb-run flutter test integration_test -d linux - - # ====================================== - # Test on Linux ARM64 - # ====================================== - - - matrix: - only: - - job_name: Test on Linux ARM64 - - install: - # Flutter SDK - - sudo sed -i "/#\$nrconf{restart} = 'i';/s/.*/\$nrconf{restart} = 'a';/" /etc/needrestart/needrestart.conf - - sudo apt update -y --allow-releaseinfo-change - - sudo apt install -y clang ninja-build xvfb libgtk-3-dev gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav - - git clone https://github.com/flutter/flutter.git -b stable "$HOME/flutter" - - export PATH="$PATH:$HOME/flutter/bin" - - source ci/install_flutter.sh - - build: off - - test_script: - - export SERIOUS_PYTHON_SITE_PACKAGES=$APPVEYOR_BUILD_FOLDER/site-packages - - cd src/serious_python/example/flet_example - - dart run serious_python:main package app/src -p Linux -r flet - - xvfb-run flutter test integration_test -d linux - - # ========================================= - # Publish serious_python package to pub.dev - # ========================================= - - - matrix: - only: - - job_name: Publish serious_python package to pub.dev - - install: - # update build version - - ps: | - if ($env:APPVEYOR_REPO_TAG_NAME) { - $env:PKG_VER = $env:APPVEYOR_REPO_TAG_NAME.replace("v", "") - } else { - $cv = [version](git describe --abbrev=0).substring(1) - $env:PKG_VER = "$($cv.major).$($cv.minor).$($env:APPVEYOR_BUILD_NUMBER)" - } - Write-Host "Package version: $($env:PKG_VER)" - - - pip3 install pyyaml - - flutter upgrade --force - - build_script: - # publish package - - sh: | - if [[ "$APPVEYOR_REPO_TAG_NAME" != "" ]]; then - mkdir -p $HOME/.config/dart - echo $PUB_DEV_TOKEN | base64 --decode > $HOME/.config/dart/pub-credentials.json - - # patch pubspecs - python3 ci/patch_pubspec.py src/serious_python_platform_interface/pubspec.yaml $PKG_VER - python3 ci/patch_pubspec.py src/serious_python/pubspec.yaml $PKG_VER - python3 ci/patch_pubspec.py src/serious_python_android/pubspec.yaml $PKG_VER - python3 ci/patch_pubspec.py src/serious_python_darwin/pubspec.yaml $PKG_VER - python3 ci/patch_pubspec.py src/serious_python_windows/pubspec.yaml $PKG_VER - python3 ci/patch_pubspec.py src/serious_python_linux/pubspec.yaml $PKG_VER - - cd src/serious_python_platform_interface - dart pub publish --force - cd $APPVEYOR_BUILD_FOLDER - - sleep 600 - - cd src/serious_python_android - dart pub publish --force - cd $APPVEYOR_BUILD_FOLDER - - cd src/serious_python_darwin - dart pub publish --force - cd $APPVEYOR_BUILD_FOLDER - - cd src/serious_python_windows - dart pub publish --force - cd $APPVEYOR_BUILD_FOLDER - - cd src/serious_python_linux - dart pub publish --force - cd $APPVEYOR_BUILD_FOLDER - - sleep 600 - - cd src/serious_python - dart pub publish --force || exit 1 - cd $APPVEYOR_BUILD_FOLDER - - elif [[ "$APPVEYOR_PULL_REQUEST_NUMBER" == "" ]]; then - - cd src/serious_python_platform_interface - dart pub publish --dry-run - cd $APPVEYOR_BUILD_FOLDER - - cd src/serious_python_android - dart pub publish --dry-run - cd $APPVEYOR_BUILD_FOLDER - - cd src/serious_python_darwin - dart pub publish --dry-run - cd $APPVEYOR_BUILD_FOLDER - - cd src/serious_python_windows - dart pub publish --dry-run - cd $APPVEYOR_BUILD_FOLDER - - cd src/serious_python_linux - dart pub publish --dry-run - cd $APPVEYOR_BUILD_FOLDER - - cd src/serious_python - dart pub publish --dry-run - cd $APPVEYOR_BUILD_FOLDER - fi - - test: off \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4d72cd2..cccc1777 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -262,7 +262,7 @@ jobs: major=$(echo "$cv" | cut -d. -f1) minor=$(echo "$cv" | cut -d. -f2) - # Construct the package version: ..0 + # Construct the package version PKG_VER="${major}.${minor}.${GITHUB_RUN_NUMBER}" fi @@ -278,6 +278,7 @@ jobs: echo "$PUB_DEV_TOKEN" | base64 --decode > $HOME/.config/dart/pub-credentials.json - name: Patch pubspec versions + if: startsWith(github.ref, 'refs/tags/v') shell: bash working-directory: "src" run: | diff --git a/ci/download_artifact.py b/ci/download_artifact.py deleted file mode 100644 index 6b37f5d7..00000000 --- a/ci/download_artifact.py +++ /dev/null @@ -1,51 +0,0 @@ -import json -import os -import pathlib -import sys -import tarfile -import urllib.request - -if len(sys.argv) < 2: - print("Specify artifact job name and artifact deployment name to download") - sys.exit(1) - -artifact_job_name = sys.argv[1] -artifact_file_name = sys.argv[2].format( - version=os.environ.get("APPVEYOR_BUILD_VERSION") -) - -build_jobs = {} - - -def download_job_artifact(job_id, file_name, dest_file): - url = f"https://ci.appveyor.com/api/buildjobs/{job_id}/artifacts/{file_name}" - print(f"Downloading {url}...") - urllib.request.urlretrieve(url, dest_file) - - -def get_build_job_ids(): - account_name = os.environ.get("APPVEYOR_ACCOUNT_NAME") - project_slug = os.environ.get("APPVEYOR_PROJECT_SLUG") - build_id = os.environ.get("APPVEYOR_BUILD_ID") - url = f"https://ci.appveyor.com/api/projects/{account_name}/{project_slug}/builds/{build_id}" - print(f"Fetching build details at {url}") - req = urllib.request.Request(url) - req.add_header("Content-type", "application/json") - project = json.loads(urllib.request.urlopen(req).read().decode()) - for job in project["build"]["jobs"]: - build_jobs[job["name"]] = job["jobId"] - - -current_dir = pathlib.Path(os.getcwd()) -print("current_dir", current_dir) - -get_build_job_ids() - -# create "web" directory -dist_path = current_dir.joinpath("python_dist") -dist_path.mkdir(exist_ok=True) -tar_path = current_dir.joinpath(artifact_file_name) -download_job_artifact(build_jobs[artifact_job_name], artifact_file_name, tar_path) -with tarfile.open(tar_path, "r:gz") as tar: - tar.extractall(str(dist_path)) -os.remove(tar_path) diff --git a/ci/install_flutter.sh b/ci/install_flutter.sh deleted file mode 100755 index 7366c8af..00000000 --- a/ci/install_flutter.sh +++ /dev/null @@ -1,6 +0,0 @@ -dart pub global activate fvm -export PATH=$HOME/.pub-cache/bin:$HOME/fvm/default/bin:$PATH -fvm install $FLUTTER_VERSION -fvm global $FLUTTER_VERSION -flutter --version -flutter doctor \ No newline at end of file diff --git a/ci/patch_pubspec.py b/ci/patch_pubspec.py deleted file mode 100644 index d655767a..00000000 --- a/ci/patch_pubspec.py +++ /dev/null @@ -1,37 +0,0 @@ -import os -import pathlib -import sys - -import yaml - -if len(sys.argv) < 3: - print("Specify pubspec.yaml file and version to patch") - sys.exit(1) - -current_dir = pathlib.Path(os.getcwd()) -pubspec_path = current_dir.joinpath(current_dir, sys.argv[1]) -ver = sys.argv[2] -print(f"Patching pubspec.yaml file {pubspec_path} with {ver}") - -dependencies = [ - "serious_python_platform_interface", - "serious_python_android", - "serious_python_darwin", - "serious_python_windows", - "serious_python_linux", - "serious_python_macos", -] - -with open(pubspec_path, "r") as f: - data = yaml.safe_load(f) - - # patch version - data["version"] = ver - - # patch dependencies - for dep in data["dependencies"]: - if dep in dependencies: - data["dependencies"][dep] = f"^{ver}" - # print(dep) -with open(pubspec_path, "w") as file: - yaml.dump(data, file, sort_keys=False) From 11f3cede3db2b01212a67b86f4c7b502cdaa9664 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Tue, 21 Oct 2025 09:34:09 -0700 Subject: [PATCH 38/49] Trying to fix publish job --- .github/workflows/ci.yml | 430 ++++++++++++++++++++------------------- 1 file changed, 217 insertions(+), 213 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cccc1777..af8b28c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,210 +21,210 @@ env: UV_PYTHON: "3.12" jobs: - macos: - name: Test on macOS - runs-on: macos-latest - 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: Run tests - shell: bash - working-directory: "src/serious_python/example/flet_example" - run: | - dart run serious_python:main package app/src --platform Darwin --requirements flet - flutter test integration_test --device-id macos - - ios: - name: Test on iOS - runs-on: macos-latest - 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: Setup iOS Simulator - id: simulator - uses: futureware-tech/simulator-action@v4 - with: - # https://github.com/futureware-tech/simulator-action/wiki/Devices-macos-latest - model: 'iPhone 16 Pro Max' - os: "iOS" - os_version: "^18.6" - shutdown_after_job: true - wait_for_boot: true - - - name: Run tests - shell: bash - working-directory: "src/serious_python/example/flet_example" - run: | - dart run serious_python:main package app/src --platform iOS --requirements flet - flutter test integration_test --device-id ${{ steps.simulator.outputs.udid }} - - android: - name: Test on Android - runs-on: ubuntu-latest - 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 - - - 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/flet_example && dart run serious_python:main package app/src --platform Android --requirements flet - cd src/serious_python/example/flet_example && flutter test integration_test --device-id emulator-${{ env.EMULATOR_PORT }} - - windows: - name: Test on Windows - runs-on: windows-latest - 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: Run tests - shell: bash - working-directory: "src/serious_python/example/flet_example" - run: | - dart run serious_python:main package app/src --platform Windows --requirements flet - flutter test integration_test -d windows - - linux: - name: Test on Linux ${{ matrix.title }} - runs-on: ${{ matrix.runner }} - strategy: - fail-fast: false - matrix: - include: - - arch: arm64 - runner: ubuntu-24.04-arm - title: ARM64 - - arch: amd64 - runner: ubuntu-24.04 - title: AMD64 - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Setup uv - uses: astral-sh/setup-uv@v6 - - - name: Get Flutter version from ".fvmrc" - uses: kuhnroyal/flutter-fvm-config-action/config@v3 - id: fvm-config-action - with: - path: '.fvmrc' - - - name: Setup Flutter - uses: subosito/flutter-action@v2 - with: - flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }} - channel: ${{ matrix.arch == 'arm64' && 'master' || 'stable' }} # https://github.com/subosito/flutter-action/issues/345#issuecomment-2657332687 - cache: true - - - name: Install dependencies - shell: bash - run: | - sudo apt-get update --allow-releaseinfo-change - sudo apt-get install -y xvfb libgtk-3-dev +# macos: +# name: Test on macOS +# runs-on: macos-latest +# 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: Run tests +# shell: bash +# working-directory: "src/serious_python/example/flet_example" +# run: | +# dart run serious_python:main package app/src --platform Darwin --requirements flet +# flutter test integration_test --device-id macos + +# ios: +# name: Test on iOS +# runs-on: macos-latest +# 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: Setup iOS Simulator +# id: simulator +# uses: futureware-tech/simulator-action@v4 +# with: +# # https://github.com/futureware-tech/simulator-action/wiki/Devices-macos-latest +# model: 'iPhone 16 Pro Max' +# os: "iOS" +# os_version: "^18.6" +# shutdown_after_job: true +# wait_for_boot: true + +# - name: Run tests +# shell: bash +# working-directory: "src/serious_python/example/flet_example" +# run: | +# dart run serious_python:main package app/src --platform iOS --requirements flet +# flutter test integration_test --device-id ${{ steps.simulator.outputs.udid }} + +# android: +# name: Test on Android +# runs-on: ubuntu-latest +# 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 + +# - 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/flet_example && dart run serious_python:main package app/src --platform Android --requirements flet +# cd src/serious_python/example/flet_example && flutter test integration_test --device-id emulator-${{ env.EMULATOR_PORT }} + +# windows: +# name: Test on Windows +# runs-on: windows-latest +# 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: Run tests +# shell: bash +# working-directory: "src/serious_python/example/flet_example" +# run: | +# dart run serious_python:main package app/src --platform Windows --requirements flet +# flutter test integration_test -d windows + +# linux: +# name: Test on Linux ${{ matrix.title }} +# runs-on: ${{ matrix.runner }} +# strategy: +# fail-fast: false +# matrix: +# include: +# - arch: arm64 +# runner: ubuntu-24.04-arm +# title: ARM64 +# - arch: amd64 +# runner: ubuntu-24.04 +# title: AMD64 +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 + +# - name: Setup uv +# uses: astral-sh/setup-uv@v6 + +# - name: Get Flutter version from ".fvmrc" +# uses: kuhnroyal/flutter-fvm-config-action/config@v3 +# id: fvm-config-action +# with: +# path: '.fvmrc' + +# - name: Setup Flutter +# uses: subosito/flutter-action@v2 +# with: +# flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }} +# channel: ${{ matrix.arch == 'arm64' && 'master' || 'stable' }} # https://github.com/subosito/flutter-action/issues/345#issuecomment-2657332687 +# cache: true + +# - name: Install dependencies +# shell: bash +# run: | +# sudo apt-get update --allow-releaseinfo-change +# sudo apt-get install -y xvfb libgtk-3-dev - if [ "${{ matrix.arch }}" = "amd64" ]; then - sudo apt-get install -y \ - libgstreamer1.0-dev \ - libgstreamer-plugins-base1.0-dev \ - libgstreamer-plugins-bad1.0-dev \ - gstreamer1.0-plugins-base \ - gstreamer1.0-plugins-good \ - gstreamer1.0-plugins-bad \ - gstreamer1.0-plugins-ugly \ - gstreamer1.0-libav \ - gstreamer1.0-tools \ - gstreamer1.0-x \ - gstreamer1.0-alsa \ - gstreamer1.0-gl \ - gstreamer1.0-gtk3 \ - gstreamer1.0-qt5 \ - gstreamer1.0-pulseaudio - else - sudo apt-get install -y \ - clang \ - ninja-build \ - gstreamer1.0-plugins-bad \ - gstreamer1.0-plugins-ugly \ - gstreamer1.0-libav - fi - - - name: Run tests - shell: bash - working-directory: src/serious_python/example/flet_example - run: | - dart run serious_python:main package app/src --platform Linux --requirements flet - xvfb-run flutter test integration_test -d linux +# if [ "${{ matrix.arch }}" = "amd64" ]; then +# sudo apt-get install -y \ +# libgstreamer1.0-dev \ +# libgstreamer-plugins-base1.0-dev \ +# libgstreamer-plugins-bad1.0-dev \ +# gstreamer1.0-plugins-base \ +# gstreamer1.0-plugins-good \ +# gstreamer1.0-plugins-bad \ +# gstreamer1.0-plugins-ugly \ +# gstreamer1.0-libav \ +# gstreamer1.0-tools \ +# gstreamer1.0-x \ +# gstreamer1.0-alsa \ +# gstreamer1.0-gl \ +# gstreamer1.0-gtk3 \ +# gstreamer1.0-qt5 \ +# gstreamer1.0-pulseaudio +# else +# sudo apt-get install -y \ +# clang \ +# ninja-build \ +# gstreamer1.0-plugins-bad \ +# gstreamer1.0-plugins-ugly \ +# gstreamer1.0-libav +# fi + +# - name: Run tests +# shell: bash +# working-directory: src/serious_python/example/flet_example +# run: | +# dart run serious_python:main package app/src --platform Linux --requirements flet +# xvfb-run flutter test integration_test -d linux publish: name: Publish to pub.dev - needs: - - macos - - ios - - android - - windows - - linux + # needs: + # - macos + # - ios + # - android + # - windows + # - linux runs-on: ubuntu-22.04 # if: startsWith(github.ref, 'refs/tags/v') steps: @@ -278,7 +278,6 @@ jobs: echo "$PUB_DEV_TOKEN" | base64 --decode > $HOME/.config/dart/pub-credentials.json - name: Patch pubspec versions - if: startsWith(github.ref, 'refs/tags/v') shell: bash working-directory: "src" run: | @@ -295,17 +294,22 @@ jobs: - name: Publish packages shell: bash - working-directory: "src" run: | - for pkg in \ - "serious_python_platform_interface" \ - "serious_python_android" \ - "serious_python_darwin" \ - "serious_python_windows" \ - "serious_python_linux" \ - "serious_python"; do - - pushd "$pkg" >/dev/null - dart pub publish --dry-run + publish_pkg () { + pushd "$1" >/dev/null + if [[ "$GITHUB_REF" == refs/tags/* ]]; then + dart pub publish --force + else + dart pub publish --dry-run + fi popd >/dev/null - done \ No newline at end of file + } + + publish_pkg src/serious_python_platform_interface + sleep 600 + publish_pkg src/serious_python_android + publish_pkg src/serious_python_darwin + publish_pkg src/serious_python_windows + publish_pkg src/serious_python_linux + sleep 600 + publish_pkg src/serious_python \ No newline at end of file From 93bddbf69aff913a2b2b5aba6f34d89e5f00aeda Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Tue, 21 Oct 2025 09:39:52 -0700 Subject: [PATCH 39/49] Replace dry-run publish with dart analyze in CI In the CI workflow, the non-tagged branch step now runs 'dart analyze' instead of 'dart pub publish --dry-run' to perform static analysis rather than a dry-run publish. This improves code quality checks during CI for non-release branches. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af8b28c7..4901892a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -300,7 +300,7 @@ jobs: if [[ "$GITHUB_REF" == refs/tags/* ]]; then dart pub publish --force else - dart pub publish --dry-run + dart analyze fi popd >/dev/null } From 09f9a0df1233a76080044967b25675aa88368c30 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Tue, 21 Oct 2025 09:43:17 -0700 Subject: [PATCH 40/49] Run 'dart pub get' before analysis in CI Adds 'dart pub get' to the CI workflow before running 'dart analyze' for non-tagged builds to ensure dependencies are installed prior to analysis. --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4901892a..ec377205 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -300,6 +300,7 @@ jobs: if [[ "$GITHUB_REF" == refs/tags/* ]]; then dart pub publish --force else + dart pub get dart analyze fi popd >/dev/null From 801012100ac27327da396ae14106326c52e8f216 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Tue, 21 Oct 2025 09:45:57 -0700 Subject: [PATCH 41/49] sleep on publish only --- .github/workflows/ci.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec377205..eaaeb420 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -299,6 +299,7 @@ jobs: pushd "$1" >/dev/null if [[ "$GITHUB_REF" == refs/tags/* ]]; then dart pub publish --force + sleep $2 else dart pub get dart analyze @@ -306,11 +307,9 @@ jobs: popd >/dev/null } - publish_pkg src/serious_python_platform_interface - sleep 600 - publish_pkg src/serious_python_android - publish_pkg src/serious_python_darwin - publish_pkg src/serious_python_windows - publish_pkg src/serious_python_linux - sleep 600 - publish_pkg src/serious_python \ No newline at end of file + publish_pkg src/serious_python_platform_interface 600 + publish_pkg src/serious_python_android 0 + publish_pkg src/serious_python_darwin 0 + publish_pkg src/serious_python_windows 0 + publish_pkg src/serious_python_linux 600 + publish_pkg src/serious_python 0 \ No newline at end of file From 40938f4724340b7f7803a2248fdf035ca8e8d60c Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Tue, 21 Oct 2025 09:48:06 -0700 Subject: [PATCH 42/49] Enable pub.dev steps only for version tags in CI Added conditional execution for pub.dev credential configuration and pubspec version patching steps to run only when the workflow is triggered by a version tag. This prevents these steps from running on non-release branches. --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eaaeb420..bc828b39 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -270,7 +270,7 @@ jobs: echo "PKG_VER=$PKG_VER" | tee -a "$GITHUB_ENV" - name: Configure pub.dev credentials - # if: ${{ secrets.PUB_DEV_TOKEN != '' }} + if: startsWith(github.ref, 'refs/tags/v') env: PUB_DEV_TOKEN: ${{ secrets.PUB_DEV_TOKEN }} run: | @@ -278,6 +278,7 @@ jobs: echo "$PUB_DEV_TOKEN" | base64 --decode > $HOME/.config/dart/pub-credentials.json - name: Patch pubspec versions + if: startsWith(github.ref, 'refs/tags/v') shell: bash working-directory: "src" run: | From 2580b3596d92b7efbc639ffe697d390a1b27c119 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Tue, 21 Oct 2025 09:50:57 -0700 Subject: [PATCH 43/49] Exclude gen.dart from analyzer checks Added lib/src/gen.dart to the analyzer exclude list in analysis_options.yaml to prevent analysis of generated code. --- src/serious_python_android/analysis_options.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/serious_python_android/analysis_options.yaml b/src/serious_python_android/analysis_options.yaml index 872a1ebd..e550cb50 100644 --- a/src/serious_python_android/analysis_options.yaml +++ b/src/serious_python_android/analysis_options.yaml @@ -1,4 +1,8 @@ include: package:flutter_lints/flutter.yaml +analyzer: + exclude: + - lib/src/gen.dart + # Additional information about this file can be found at # https://dart.dev/guides/language/analysis-options \ No newline at end of file From cb90c15ed009b5a7616fd060775d8409ca1a30ab Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Tue, 21 Oct 2025 09:57:22 -0700 Subject: [PATCH 44/49] Enable tag-based publishing in CI workflow Removes conditional checks and ensures publishing steps run only for tag refs starting with 'v'. Simplifies the publish_pkg function to always publish and adjusts sleep intervals between package publishes. --- .github/workflows/ci.yml | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc828b39..00cbe9ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -226,7 +226,7 @@ jobs: # - windows # - linux runs-on: ubuntu-22.04 - # if: startsWith(github.ref, 'refs/tags/v') + if: startsWith(github.ref, 'refs/tags/v') steps: - name: Checkout repository @@ -270,7 +270,6 @@ jobs: echo "PKG_VER=$PKG_VER" | tee -a "$GITHUB_ENV" - name: Configure pub.dev credentials - if: startsWith(github.ref, 'refs/tags/v') env: PUB_DEV_TOKEN: ${{ secrets.PUB_DEV_TOKEN }} run: | @@ -278,7 +277,6 @@ jobs: echo "$PUB_DEV_TOKEN" | base64 --decode > $HOME/.config/dart/pub-credentials.json - name: Patch pubspec versions - if: startsWith(github.ref, 'refs/tags/v') shell: bash working-directory: "src" run: | @@ -298,19 +296,15 @@ jobs: run: | publish_pkg () { pushd "$1" >/dev/null - if [[ "$GITHUB_REF" == refs/tags/* ]]; then - dart pub publish --force - sleep $2 - else - dart pub get - dart analyze - fi + dart pub publish --force popd >/dev/null } - publish_pkg src/serious_python_platform_interface 600 - publish_pkg src/serious_python_android 0 - publish_pkg src/serious_python_darwin 0 - publish_pkg src/serious_python_windows 0 - publish_pkg src/serious_python_linux 600 - publish_pkg src/serious_python 0 \ No newline at end of file + publish_pkg src/serious_python_platform_interface + sleep 600 + publish_pkg src/serious_python_android + publish_pkg src/serious_python_darwin + publish_pkg src/serious_python_windows + publish_pkg src/serious_python_linux + sleep 600 + publish_pkg src/serious_python \ No newline at end of file From 6d63ebb9587b7bf62d21481d3e047e940fae983e Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Tue, 21 Oct 2025 09:58:32 -0700 Subject: [PATCH 45/49] Enable CI jobs for all platforms Uncommented and activated CI jobs for macOS, iOS, Android, Windows, and Linux in the GitHub Actions workflow. The publish job now depends on successful completion of all platform tests, improving cross-platform coverage and release reliability. --- .github/workflows/ci.yml | 400 +++++++++++++++++++-------------------- 1 file changed, 200 insertions(+), 200 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00cbe9ef..eaaaf1b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,210 +21,210 @@ env: UV_PYTHON: "3.12" jobs: -# macos: -# name: Test on macOS -# runs-on: macos-latest -# 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: Run tests -# shell: bash -# working-directory: "src/serious_python/example/flet_example" -# run: | -# dart run serious_python:main package app/src --platform Darwin --requirements flet -# flutter test integration_test --device-id macos - -# ios: -# name: Test on iOS -# runs-on: macos-latest -# 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: Setup iOS Simulator -# id: simulator -# uses: futureware-tech/simulator-action@v4 -# with: -# # https://github.com/futureware-tech/simulator-action/wiki/Devices-macos-latest -# model: 'iPhone 16 Pro Max' -# os: "iOS" -# os_version: "^18.6" -# shutdown_after_job: true -# wait_for_boot: true - -# - name: Run tests -# shell: bash -# working-directory: "src/serious_python/example/flet_example" -# run: | -# dart run serious_python:main package app/src --platform iOS --requirements flet -# flutter test integration_test --device-id ${{ steps.simulator.outputs.udid }} - -# android: -# name: Test on Android -# runs-on: ubuntu-latest -# 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 - -# - 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/flet_example && dart run serious_python:main package app/src --platform Android --requirements flet -# cd src/serious_python/example/flet_example && flutter test integration_test --device-id emulator-${{ env.EMULATOR_PORT }} - -# windows: -# name: Test on Windows -# runs-on: windows-latest -# 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: Run tests -# shell: bash -# working-directory: "src/serious_python/example/flet_example" -# run: | -# dart run serious_python:main package app/src --platform Windows --requirements flet -# flutter test integration_test -d windows - -# linux: -# name: Test on Linux ${{ matrix.title }} -# runs-on: ${{ matrix.runner }} -# strategy: -# fail-fast: false -# matrix: -# include: -# - arch: arm64 -# runner: ubuntu-24.04-arm -# title: ARM64 -# - arch: amd64 -# runner: ubuntu-24.04 -# title: AMD64 -# steps: -# - name: Checkout repository -# uses: actions/checkout@v4 - -# - name: Setup uv -# uses: astral-sh/setup-uv@v6 - -# - name: Get Flutter version from ".fvmrc" -# uses: kuhnroyal/flutter-fvm-config-action/config@v3 -# id: fvm-config-action -# with: -# path: '.fvmrc' - -# - name: Setup Flutter -# uses: subosito/flutter-action@v2 -# with: -# flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }} -# channel: ${{ matrix.arch == 'arm64' && 'master' || 'stable' }} # https://github.com/subosito/flutter-action/issues/345#issuecomment-2657332687 -# cache: true - -# - name: Install dependencies -# shell: bash -# run: | -# sudo apt-get update --allow-releaseinfo-change -# sudo apt-get install -y xvfb libgtk-3-dev + macos: + name: Test on macOS + runs-on: macos-latest + 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: Run tests + shell: bash + working-directory: "src/serious_python/example/flet_example" + run: | + dart run serious_python:main package app/src --platform Darwin --requirements flet + flutter test integration_test --device-id macos + + ios: + name: Test on iOS + runs-on: macos-latest + 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: Setup iOS Simulator + id: simulator + uses: futureware-tech/simulator-action@v4 + with: + # https://github.com/futureware-tech/simulator-action/wiki/Devices-macos-latest + model: 'iPhone 16 Pro Max' + os: "iOS" + os_version: "^18.6" + shutdown_after_job: true + wait_for_boot: true + + - name: Run tests + shell: bash + working-directory: "src/serious_python/example/flet_example" + run: | + dart run serious_python:main package app/src --platform iOS --requirements flet + flutter test integration_test --device-id ${{ steps.simulator.outputs.udid }} + + android: + name: Test on Android + runs-on: ubuntu-latest + 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 + + - 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/flet_example && dart run serious_python:main package app/src --platform Android --requirements flet + cd src/serious_python/example/flet_example && flutter test integration_test --device-id emulator-${{ env.EMULATOR_PORT }} + + windows: + name: Test on Windows + runs-on: windows-latest + 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: Run tests + shell: bash + working-directory: "src/serious_python/example/flet_example" + run: | + dart run serious_python:main package app/src --platform Windows --requirements flet + flutter test integration_test -d windows + + linux: + name: Test on Linux ${{ matrix.title }} + runs-on: ${{ matrix.runner }} + strategy: + fail-fast: false + matrix: + include: + - arch: arm64 + runner: ubuntu-24.04-arm + title: ARM64 + - arch: amd64 + runner: ubuntu-24.04 + title: AMD64 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup uv + uses: astral-sh/setup-uv@v6 + + - name: Get Flutter version from ".fvmrc" + uses: kuhnroyal/flutter-fvm-config-action/config@v3 + id: fvm-config-action + with: + path: '.fvmrc' + + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }} + channel: ${{ matrix.arch == 'arm64' && 'master' || 'stable' }} # https://github.com/subosito/flutter-action/issues/345#issuecomment-2657332687 + cache: true + + - name: Install dependencies + shell: bash + run: | + sudo apt-get update --allow-releaseinfo-change + sudo apt-get install -y xvfb libgtk-3-dev -# if [ "${{ matrix.arch }}" = "amd64" ]; then -# sudo apt-get install -y \ -# libgstreamer1.0-dev \ -# libgstreamer-plugins-base1.0-dev \ -# libgstreamer-plugins-bad1.0-dev \ -# gstreamer1.0-plugins-base \ -# gstreamer1.0-plugins-good \ -# gstreamer1.0-plugins-bad \ -# gstreamer1.0-plugins-ugly \ -# gstreamer1.0-libav \ -# gstreamer1.0-tools \ -# gstreamer1.0-x \ -# gstreamer1.0-alsa \ -# gstreamer1.0-gl \ -# gstreamer1.0-gtk3 \ -# gstreamer1.0-qt5 \ -# gstreamer1.0-pulseaudio -# else -# sudo apt-get install -y \ -# clang \ -# ninja-build \ -# gstreamer1.0-plugins-bad \ -# gstreamer1.0-plugins-ugly \ -# gstreamer1.0-libav -# fi - -# - name: Run tests -# shell: bash -# working-directory: src/serious_python/example/flet_example -# run: | -# dart run serious_python:main package app/src --platform Linux --requirements flet -# xvfb-run flutter test integration_test -d linux + if [ "${{ matrix.arch }}" = "amd64" ]; then + sudo apt-get install -y \ + libgstreamer1.0-dev \ + libgstreamer-plugins-base1.0-dev \ + libgstreamer-plugins-bad1.0-dev \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad \ + gstreamer1.0-plugins-ugly \ + gstreamer1.0-libav \ + gstreamer1.0-tools \ + gstreamer1.0-x \ + gstreamer1.0-alsa \ + gstreamer1.0-gl \ + gstreamer1.0-gtk3 \ + gstreamer1.0-qt5 \ + gstreamer1.0-pulseaudio + else + sudo apt-get install -y \ + clang \ + ninja-build \ + gstreamer1.0-plugins-bad \ + gstreamer1.0-plugins-ugly \ + gstreamer1.0-libav + fi + + - name: Run tests + shell: bash + working-directory: src/serious_python/example/flet_example + run: | + dart run serious_python:main package app/src --platform Linux --requirements flet + xvfb-run flutter test integration_test -d linux publish: name: Publish to pub.dev - # needs: - # - macos - # - ios - # - android - # - windows - # - linux + needs: + - macos + - ios + - android + - windows + - linux runs-on: ubuntu-22.04 if: startsWith(github.ref, 'refs/tags/v') steps: From 6e22048a02815ebaa7efcbb32e575edf0853d77e Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Tue, 21 Oct 2025 10:21:25 -0700 Subject: [PATCH 46/49] Remove explicit shell specification from CI steps Eliminated redundant 'shell: bash' lines from multiple workflow steps in .github/workflows/ci.yml to simplify configuration and rely on default shell behavior. --- .github/workflows/ci.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eaaaf1b5..c54d7d1e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,6 @@ jobs: cache: true - name: Run tests - shell: bash working-directory: "src/serious_python/example/flet_example" run: | dart run serious_python:main package app/src --platform Darwin --requirements flet @@ -66,7 +65,6 @@ jobs: wait_for_boot: true - name: Run tests - shell: bash working-directory: "src/serious_python/example/flet_example" run: | dart run serious_python:main package app/src --platform iOS --requirements flet @@ -139,7 +137,6 @@ jobs: cache: true - name: Run tests - shell: bash working-directory: "src/serious_python/example/flet_example" run: | dart run serious_python:main package app/src --platform Windows --requirements flet @@ -179,7 +176,6 @@ jobs: cache: true - name: Install dependencies - shell: bash run: | sudo apt-get update --allow-releaseinfo-change sudo apt-get install -y xvfb libgtk-3-dev @@ -211,7 +207,6 @@ jobs: fi - name: Run tests - shell: bash working-directory: src/serious_python/example/flet_example run: | dart run serious_python:main package app/src --platform Linux --requirements flet @@ -244,7 +239,6 @@ jobs: cache: true - name: Compute PKG_VER - shell: bash run: | if [[ "$GITHUB_REF" == refs/tags/* ]]; then # Extract the tag name @@ -274,10 +268,9 @@ jobs: PUB_DEV_TOKEN: ${{ secrets.PUB_DEV_TOKEN }} run: | mkdir -p $HOME/.config/dart - echo "$PUB_DEV_TOKEN" | base64 --decode > $HOME/.config/dart/pub-credentials.json + echo "${{ secrets.PUB_DEV_TOKEN }}" | base64 --decode > $HOME/.config/dart/pub-credentials.json - name: Patch pubspec versions - shell: bash working-directory: "src" run: | for pkg in \ @@ -292,7 +285,6 @@ jobs: done - name: Publish packages - shell: bash run: | publish_pkg () { pushd "$1" >/dev/null From 367ef73f0019b20eca995030755adb1bfccab5cd Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Tue, 21 Oct 2025 10:34:06 -0700 Subject: [PATCH 47/49] Remove commented concurrency config from CI workflow Deleted unused, commented-out concurrency settings from the GitHub Actions CI workflow file to clean up configuration. --- .github/workflows/ci.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c54d7d1e..4ce14d90 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,11 +9,6 @@ on: pull_request: workflow_dispatch: - -#concurrency: -# group: ci-${{ github.workflow }}-${{ github.event.pull_request.head.ref || github.ref_name }} -# cancel-in-progress: true - env: ROOT: "${{ github.workspace }}" SCRIPTS: "${{ github.workspace }}/.github/scripts" @@ -264,8 +259,6 @@ jobs: echo "PKG_VER=$PKG_VER" | tee -a "$GITHUB_ENV" - name: Configure pub.dev credentials - env: - PUB_DEV_TOKEN: ${{ secrets.PUB_DEV_TOKEN }} run: | mkdir -p $HOME/.config/dart echo "${{ secrets.PUB_DEV_TOKEN }}" | base64 --decode > $HOME/.config/dart/pub-credentials.json From d37378d84bb41564af0f8509f0940b39ab16b880 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Tue, 21 Oct 2025 10:41:00 -0700 Subject: [PATCH 48/49] Remove download_artifact.py script Deleted the .github/scripts/download_artifact.py script, which handled downloading and extracting build artifacts from AppVeyor. This cleanup removes unused or obsolete CI utility code. --- .github/scripts/download_artifact.py | 51 ---------------------------- 1 file changed, 51 deletions(-) delete mode 100644 .github/scripts/download_artifact.py diff --git a/.github/scripts/download_artifact.py b/.github/scripts/download_artifact.py deleted file mode 100644 index 6b37f5d7..00000000 --- a/.github/scripts/download_artifact.py +++ /dev/null @@ -1,51 +0,0 @@ -import json -import os -import pathlib -import sys -import tarfile -import urllib.request - -if len(sys.argv) < 2: - print("Specify artifact job name and artifact deployment name to download") - sys.exit(1) - -artifact_job_name = sys.argv[1] -artifact_file_name = sys.argv[2].format( - version=os.environ.get("APPVEYOR_BUILD_VERSION") -) - -build_jobs = {} - - -def download_job_artifact(job_id, file_name, dest_file): - url = f"https://ci.appveyor.com/api/buildjobs/{job_id}/artifacts/{file_name}" - print(f"Downloading {url}...") - urllib.request.urlretrieve(url, dest_file) - - -def get_build_job_ids(): - account_name = os.environ.get("APPVEYOR_ACCOUNT_NAME") - project_slug = os.environ.get("APPVEYOR_PROJECT_SLUG") - build_id = os.environ.get("APPVEYOR_BUILD_ID") - url = f"https://ci.appveyor.com/api/projects/{account_name}/{project_slug}/builds/{build_id}" - print(f"Fetching build details at {url}") - req = urllib.request.Request(url) - req.add_header("Content-type", "application/json") - project = json.loads(urllib.request.urlopen(req).read().decode()) - for job in project["build"]["jobs"]: - build_jobs[job["name"]] = job["jobId"] - - -current_dir = pathlib.Path(os.getcwd()) -print("current_dir", current_dir) - -get_build_job_ids() - -# create "web" directory -dist_path = current_dir.joinpath("python_dist") -dist_path.mkdir(exist_ok=True) -tar_path = current_dir.joinpath(artifact_file_name) -download_job_artifact(build_jobs[artifact_job_name], artifact_file_name, tar_path) -with tarfile.open(tar_path, "r:gz") as tar: - tar.extractall(str(dist_path)) -os.remove(tar_path) From e0f7a5e92664573f3c697c5de5f6aef5ed8ccb27 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Tue, 21 Oct 2025 10:53:21 -0700 Subject: [PATCH 49/49] Add flutter pub get to CI test workflow Ensures Flutter dependencies are installed before running integration tests in the CI pipeline for the flet_example project. --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ce14d90..0dda04c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -204,6 +204,7 @@ jobs: - name: Run tests working-directory: src/serious_python/example/flet_example run: | + flutter pub get dart run serious_python:main package app/src --platform Linux --requirements flet xvfb-run flutter test integration_test -d linux