E2E tests #366
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: E2E tests | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- "*.md" | |
workflow_dispatch: | |
workflow_call: | |
env: | |
FLUTTER_VERSION: "3.19.2" | |
jobs: | |
ios-integration-test: | |
runs-on: macos-13-xlarge | |
timeout-minutes: 45 | |
strategy: | |
matrix: | |
device: | |
# the name of the simulator could be different depending on the macos version you are using | |
- "iPhone 15 Simulator (17.2)" | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- 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 -m 1 "^${{ matrix.device }}" | awk '{gsub(/[()]/,""); print $NF}') | |
echo $UDID | |
xcrun simctl boot "${UDID:?No Simulator with this name found}" | |
- name: Cache Flutter dependencies | |
uses: actions/cache@v4 | |
with: | |
path: /Users/runner/hostedtoolcache/flutter # For mac OS | |
key: ${{ runner.os }}-flutter-install-cache-${{ env.FLUTTER_VERSION }} | |
- name: Setup Flutter SDK | |
uses: subosito/flutter-action@62f096cacda5168a3bd7b95793373be14fa4fbaf # v2.13.0 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
channel: stable | |
- name: Install Flutter dependencies | |
run: flutter pub get | |
- name: Run iOS integration tests | |
env: | |
BKT_API_KEY: ${{ secrets.BKT_API_KEY }} | |
BKT_API_ENDPOINT: ${{ secrets.BKT_API_ENDPOINT }} | |
run: make e2e | |
android-integration-test: | |
# macos-13-xlarge is an M1 mac (which has no Android SDK) | |
runs-on: macos-13-large | |
timeout-minutes: 45 | |
strategy: | |
matrix: | |
api-level: | |
- 32 | |
target: | |
- google_apis | |
arch: | |
- x86_64 | |
cores: | |
- 8 | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache Flutter dependencies | |
uses: actions/cache@v4 | |
with: | |
path: /Users/runner/hostedtoolcache/flutter # For mac OS | |
key: ${{ runner.os }}-flutter-install-cache-${{ env.FLUTTER_VERSION }} | |
- name: Setup Flutter SDK | |
uses: subosito/flutter-action@62f096cacda5168a3bd7b95793373be14fa4fbaf # v2.13.0 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
channel: stable | |
- name: Install Flutter dependencies | |
run: flutter pub get | |
- 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@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2.30.1 | |
with: | |
api-level: ${{ matrix.api-level }} | |
target: ${{ matrix.target }} | |
arch: ${{ matrix.arch }} | |
cores: ${{ matrix.cores }} | |
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 Android integration tests | |
env: | |
BKT_API_KEY: ${{ secrets.BKT_API_KEY }} | |
BKT_API_ENDPOINT: ${{ secrets.BKT_API_ENDPOINT }} | |
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-Xmx1536m -XX:MaxMetaspaceSize=2g" | |
uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2.30.1 | |
with: | |
api-level: ${{ matrix.api-level }} | |
target: ${{ matrix.target }} | |
arch: ${{ matrix.arch }} | |
cores: ${{ matrix.cores }} | |
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: make e2e |