From 5806925197bc5422105168dfc12ed9ad216e0738 Mon Sep 17 00:00:00 2001 From: evgeny Date: Mon, 7 Oct 2024 17:15:54 +0100 Subject: [PATCH] chore: update github actions --- .github/workflows/check.yaml | 4 +- .github/workflows/docs.yml | 4 +- .github/workflows/flutter_example_app.yaml | 13 ++---- .github/workflows/flutter_integration.yaml | 49 +++++++++++++++------- 4 files changed, 42 insertions(+), 28 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index b4afb6f81..5e7625ab5 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -10,11 +10,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 with: - flutter-version: '3.0.x' + flutter-version: '3.24' cache: true # This step requires fetch of test_integration packages because flutter format and diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index fb76c20b6..fbca36013 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -10,11 +10,11 @@ jobs: deployments: write id-token: write steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 with: - flutter-version: '3.0.x' + flutter-version: '3.24' cache: true - name: Use Intro Blurb As Homepage diff --git a/.github/workflows/flutter_example_app.yaml b/.github/workflows/flutter_example_app.yaml index 28d6dc298..ed7bd1206 100644 --- a/.github/workflows/flutter_example_app.yaml +++ b/.github/workflows/flutter_example_app.yaml @@ -8,11 +8,11 @@ jobs: ios: runs-on: "macos-latest" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 with: - flutter-version: "3.0.x" + flutter-version: "3.24" cache: true - name: "Build example app for iOS" @@ -23,16 +23,11 @@ jobs: android: runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-java@v3 - with: - distribution: "temurin" - java-version: "11" + - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 with: - flutter-version: "3.0.x" + flutter-version: "3.24" cache: true - name: "Build example app for Android" diff --git a/.github/workflows/flutter_integration.yaml b/.github/workflows/flutter_integration.yaml index 078db40e5..6066311b6 100644 --- a/.github/workflows/flutter_integration.yaml +++ b/.github/workflows/flutter_integration.yaml @@ -10,9 +10,9 @@ jobs: strategy: matrix: device: # Device names must be shown in `xcrun simctl list devices` - - 'iPhone 12' # we are not specifying the iOS version as it tends to change + - 'iPhone 16' # we are not specifying the iOS version as it tends to change fail-fast: false - runs-on: 'macos-11' + runs-on: macos-latest steps: - name: 'List Simulators' run: 'xcrun simctl list devices' @@ -20,11 +20,11 @@ jobs: - name: 'Start Simulator' run: xcrun simctl boot "${{ matrix.device }}" - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 with: - flutter-version: '3.0.x' + flutter-version: '3.24' cache: true # test_integration package depends on ably_flutter, so before we run integration @@ -38,31 +38,50 @@ jobs: cd test_integration && ./run_integration_tests.sh android: + runs-on: ubuntu-latest strategy: matrix: - api-level: [24, 29] + api-level: [24, 29, 33] fail-fast: false - - runs-on: 'macos-11' - steps: - - uses: actions/checkout@v3 + - name: checkout + uses: actions/checkout@v4 - - uses: actions/setup-java@v3 - with: - distribution: 'corretto' - java-version: '11' + - 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 - uses: subosito/flutter-action@v2 with: - flutter-version: '3.0.x' + flutter-version: '3.24' cache: true + - name: AVD cache + uses: actions/cache@v4 + id: avd-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: avd-${{ matrix.api-level }} + + - name: create AVD and generate snapshot for caching + if: steps.avd-cache.outputs.cache-hit != 'true' + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: ${{ matrix.api-level }} + force-avd-creation: false + emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: false + script: echo "Generated AVD snapshot for caching." + - name: 'Run Flutter Driver tests' - timeout-minutes: 30 uses: reactivecircus/android-emulator-runner@v2 with: api-level: ${{ matrix.api-level }} + force-avd-creation: false emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true script: |