Flutter@3.3 #26
Workflow file for this run
This file contains 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
on: | |
push: | |
jobs: | |
android_apk: | |
name: Android APKs | |
if: false | |
strategy: | |
matrix: | |
flutter-version: | |
- 3.x | |
- 3.0.0 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- id: flutter-action | |
uses: subosito/flutter-action@v2 | |
with: | |
cache: true | |
flutter-version: ${{ matrix.flutter-version }} | |
- name: Cache pub get | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.PUB_CACHE }} | |
key: pub-cache-ubuntu-latest-${{ steps.flutter-action.outputs.VERSION }}-${{ hashFiles('example/pubspec.lock') }} | |
- name: Setup Java 11 | |
uses: actions/setup-java@v3 | |
with: | |
cache: gradle | |
distribution: temurin | |
java-version: "11" | |
- run: flutter build apk --split-per-abi | |
working-directory: example | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ steps.flutter-action.outputs.VERSION }}-arm64-v8a | |
path: example/build/app/outputs/flutter-apk/app-arm64-v8a-release.apk | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ steps.flutter-action.outputs.VERSION }}-armeabi-v7a | |
path: example/build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ steps.flutter-action.outputs.VERSION }}-x86_64 | |
path: example/build/app/outputs/flutter-apk/app-x86_64-release.apk | |
android_test: | |
name: Android integration tests | |
strategy: | |
matrix: | |
include: | |
- avd-api-level: 30 | |
avd-arch: x86 | |
avd-channel: canary | |
avd-target: aosp_atd | |
flutter-version: 3.3.x | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- id: flutter-action | |
uses: subosito/flutter-action@v2 | |
with: | |
cache: true | |
flutter-version: ${{ matrix.flutter-version }} | |
- name: Cache pub get | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.PUB_CACHE }} | |
key: pub-cache-${{ steps.flutter-action.outputs.VERSION }}-${{ hashFiles('example/pubspec.lock') }} | |
# pre-build the app to (hopefully) speed up the test execution time, | |
# avoiding the `Test timed out after 12 minutes.` error. | |
# Apparently the timeout could not be configured, see https://github.com/flutter/flutter/issues/105913 | |
- name: Run flutter build apk | |
run: | | |
set -e | |
# use Java 11 | |
export JAVA_HOME=$JAVA_HOME_11_X64 | |
echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV | |
flutter build apk --debug --target=integration_test/app_test.dart | |
working-directory: example | |
- name: AVD cache | |
uses: actions/cache@v3 | |
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.avd-api-level }} | |
arch: ${{ matrix.avd-arch }} | |
channel: ${{ matrix.avd-channel }} | |
target: ${{ matrix.avd-target }} | |
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: Execute integration test | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.avd-api-level }} | |
arch: ${{ matrix.avd-arch }} | |
channel: ${{ matrix.avd-channel }} | |
target: ${{ matrix.avd-target }} | |
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: ./example/integration_test/execute.sh | |
ios_test: | |
name: iOS integration tests | |
if: false | |
strategy: | |
matrix: | |
include: | |
# oldest available macOS version on GitHub Actions with latest Flutter version | |
- flutter-version: 3.x | |
macos-version: macos-11 | |
skip-tests: true # flakiness | |
# latest available macOS version on GitHub Actions with latest Flutter version | |
- flutter-version: 3.x | |
macos-version: macos-13 | |
# oldest supported combination | |
- flutter-version: 3.0.0 | |
macos-version: macos-11 | |
skip-tests: true # flakiness | |
runs-on: ${{ matrix.macos-version }} | |
steps: | |
- uses: actions/checkout@v3 | |
- id: flutter-action | |
uses: subosito/flutter-action@v2 | |
with: | |
cache: true | |
flutter-version: ${{ matrix.flutter-version }} | |
- name: Cache pub get | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.PUB_CACHE }} | |
key: pub-cache-${{ matrix.macos-version }}-${{ steps.flutter-action.outputs.VERSION }}-${{ hashFiles('example/pubspec.lock') }} | |
- name: Cache CocoaPods | |
uses: actions/cache@v3 | |
with: | |
path: example/ios/Pods | |
key: example-ios-pods-${{ matrix.macos-version }}-${{ steps.flutter-action.outputs.VERSION }}-${{ hashFiles('example/ios/Podfile.lock') }} | |
- name: Create iOS simulator | |
run: | | |
set -e | |
_runtime=$(xcrun simctl list runtimes ios -j | jq -r '.runtimes[-1]') | |
_runtimeId=$(echo $_runtime | jq -r .identifier) | |
echo "_runtimeId=$_runtimeId" | |
_deviceType=$(echo $_runtime | jq -r '.supportedDeviceTypes[-1]') | |
_deviceTypeName=$(echo $_deviceType | jq -r .name) | |
echo "_deviceTypeName=$_deviceTypeName" | |
_deviceTypeId=$(echo $_deviceType | jq -r .identifier) | |
echo "_deviceTypeId=$_deviceTypeId" | |
xcrun simctl create "$_deviceTypeName" "$_deviceTypeId" "$_runtimeId" | xargs xcrun simctl boot | |
# pre-build the app to (hopefully) speed up the test execution time, | |
# avoiding the `Test timed out after 12 minutes.` error. | |
# Apparently the timeout could not be configured, see https://github.com/flutter/flutter/issues/105913 | |
- run: flutter build ios --simulator --target=integration_test/app_test.dart | |
working-directory: example | |
- run: ./example/integration_test/execute.sh | |
if: ${{ !matrix.skip-tests }} |