Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .github/workflows/build.android.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: build-android
on:
push:
- main

needs: test
name: build.android
on: [pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:android:
build_android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build.ios.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: build-ios
on:
push:
- main

name: build.ios
on: [pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:ios:
build_ios:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
Expand Down
55 changes: 33 additions & 22 deletions .github/workflows/prepare.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: prepare
on:
push:
# Sequence of patterns matched against refs/heads
branches:
- main
on: [pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
analyze:
runs-on: ubuntu-latest
Expand All @@ -13,35 +12,47 @@ jobs:
with:
channel: "stable"
cache: true
- run: flutter precache
- run: flutter pub get
- run: flutter analyze --no-pub

test:
needs: analyze
strategy:
matrix:
device:
# The available simulators are listed by the "xcrun xctrace list devices" command
- "iPhone 12 Simulator (15.2)" # the name of the simulator could be different depending on the macos version you are using
# if one of the jobs in the matrix expansion fails, the rest of the jobs will be cancelled
api-level: [29]
fail-fast: true
runs-on: macos-latest
runs-on: ubuntu-latest

steps:
- name: "List all simulators"
run: "xcrun xctrace list devices"
- name: "Start Simulator"
# the command "xcrun simctl boot" expects a device identifier
# the assignment of the UDID variable consists of retrieving the ID of the simulator
# by extracting it from the command "xcrun xctrace list devices"
run: |
UDID=$(xcrun xctrace list devices | grep "^${{ matrix.device }}" | awk '{gsub(/[()]/,""); print $NF}')
echo $UDID
xcrun simctl boot "${UDID:?No Simulator with this name found}"
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true

- 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.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 integration tests"
run: flutter test integration_test
uses: reactivecircus/android-emulator-runner@v2
with:
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
api-level: ${{ matrix.api-level }}
script: flutter test integration_test