Skip to content

Clean up PR

Clean up PR #37

Workflow file for this run

on:
push:
env:
FLUTTER_VERSION_LATEST: any
FLUTTER_VERSION_MINIMUM: 3.0.0
MACOS_VERSION_LATEST: macos-latest
MACOS_VERSION_MINIMUM: macos-11
SCRIPT: ./example/integration_test/execute.sh
jobs:
android:
name: Android integration tests
strategy:
fail-fast: false
matrix:
include:
- avd-api-level: 21
avd-target: google_apis
flutter-version: ${{ env.FLUTTER_VERSION_MINIMUM }}

Check failure on line 20 in .github/workflows/pipeline.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/pipeline.yml

Invalid workflow file

The workflow is not valid. .github/workflows/pipeline.yml (Line: 20, Col: 30): Unrecognized named-value: 'env'. Located at position 1 within expression: env.FLUTTER_VERSION_MINIMUM .github/workflows/pipeline.yml (Line: 21, Col: 28): Unrecognized named-value: 'env'. Located at position 1 within expression: env.MACOS_VERSION_MINIMUM
macos-version: ${{ env.MACOS_VERSION_MINIMUM }}
- avd-api-level: 34
avd-target: google_apis
flutter-version: ${{ env.FLUTTER_VERSION_LATEST }}
macos-version: ${{ env.MACOS_VERSION_LATEST }}
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-${{ 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 pre-installed 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.avd-api-level }}-${{ matrix.avd-target }}
- 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: x86_64
disk-size: 2G
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: RUN ${{ env.SCRIPT }}
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.avd-api-level }}
arch: x86_64
disk-size: 2G
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: ${{ env.SCRIPT }}
ios:
name: iOS integration tests
strategy:
fail-fast: false
matrix:
include:
- flutter-version: ${{ env.FLUTTER_VERSION_MINIMUM }}
macos-version: ${{ env.MACOS_VERSION_MINIMUM }}
- flutter-version: ${{ env.FLUTTER_VERSION_LATEST }}
macos-version: ${{ env.MACOS_VERSION_LATEST }}
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-${{ 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
# https://github.com/flutter/flutter/issues/105913
- run: flutter build ios --simulator --target=integration_test/app_test.dart
working-directory: example
- run: ${{ env.SCRIPT }}