updates #11
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| tags: | |
| - '*' | |
| 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 | |
| env: | |
| ROOT: "${{ github.workspace }}" | |
| SCRIPTS: "${{ github.workspace }}/.github/scripts" | |
| SERIOUS_PYTHON_SITE_PACKAGES: "${{ github.workspace }}/site-packages" | |
| UV_PYTHON: "3.12" | |
| jobs: | |
| macos: | |
| name: Test on macOS | |
| runs-on: macos-15 | |
| 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 -p Darwin -r flet -r --pre | |
| flutter test integration_test --device-id macos | |
| ios: | |
| name: Test on iOS | |
| runs-on: macos-15 | |
| if: false | |
| 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 | |
| shell: bash | |
| working-directory: "src/serious_python/example/flet_example" | |
| run: | | |
| 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 "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 & | |
| 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 | |
| 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 | |
| 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: | |
| 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 | |
| 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 | |
| adb wait-for-device shell 'while [[ -z $(getprop dev.bootcomplete) ]]; do sleep 1; done;' | |
| echo "XXXXXX YYY ZZZ" | |
| 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-24.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-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-24.04-arm | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - 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 | |
| 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 |