Skip to content

Separate Android and Linux CI builds and add transport policy/capabilities #23

Separate Android and Linux CI builds and add transport policy/capabilities

Separate Android and Linux CI builds and add transport policy/capabilities #23

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
- master
env:
FLUTTER_VERSION: '3.38.9'
jobs:
pigeon_contracts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- run: dart run melos bootstrap
- run: dart run pigeon --input pigeons/midi_api.dart
- run: git diff --exit-code -- packages/flutter_midi_command_platform_interface/lib/src/pigeon packages/flutter_midi_command_android/android/src/main/kotlin/com/invisiblewrench/fluttermidicommand/pigeon packages/flutter_midi_command_darwin/ios/Classes/pigeon
dart_checks:
runs-on: ubuntu-latest
needs: pigeon_contracts
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- run: dart pub global activate melos
- run: melos bootstrap
- run: melos run analyze
- run: melos run test
- run: melos run test:web:chrome
native_android_checks:
runs-on: ubuntu-latest
needs: pigeon_contracts
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- run: dart pub global activate melos
- run: melos bootstrap
- name: Android native unit tests
run: bash ./example/android/gradlew -p example/android :flutter_midi_command_android:testDebugUnitTest
native_darwin_checks:
runs-on: macos-latest
needs: pigeon_contracts
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- run: dart pub global activate melos
- run: melos bootstrap
- name: Darwin native tests
run: melos run test:native:darwin
native_linux_checks:
runs-on: ubuntu-latest
needs: pigeon_contracts
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- run: dart pub global activate melos
- run: melos bootstrap
- name: Linux backend tests
run: melos run test:native:linux
native_windows_checks:
runs-on: windows-latest
needs: pigeon_contracts
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- run: dart pub global activate melos
- run: melos bootstrap
- name: Windows backend tests
run: melos run test:native:windows
example_android:
runs-on: ubuntu-latest
needs: [dart_checks, native_android_checks]
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- run: dart pub global activate melos
- run: melos bootstrap
- name: Build example app (Android)
run: melos run build:example:android
- name: Enable KVM
run: |
sudo tee /etc/udev/rules.d/99-kvm4all.rules <<'EOF'
KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"
EOF
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Run smoke test (Android emulator)
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 35
arch: x86_64
target: google_apis
profile: pixel_6
disable-animations: true
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -no-snapshot -no-snapshot-save
script: melos run test:example:integration:android
env:
ANDROID_DEVICE_ID: emulator-5554
ANDROID_SMOKE_MAX_ATTEMPTS: "3"
example_linux:
runs-on: ubuntu-latest
needs: [dart_checks, native_linux_checks]
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: Install Linux build dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev xvfb
- run: dart pub global activate melos
- run: melos bootstrap
- name: Build example app (Linux)
run: melos run build:example:linux
- name: Run smoke test (Linux)
run: xvfb-run -a melos run test:example:integration:linux
example_apple:
runs-on: macos-latest
needs: [dart_checks, native_darwin_checks]
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- run: dart pub global activate melos
- run: melos bootstrap
- name: Build example app (iOS)
run: melos run build:example:ios
- name: Build example app (macOS)
run: melos run build:example:macos
- name: Run smoke test (macOS)
run: melos run test:example:integration:macos
- name: Run smoke test (iOS simulator)
run: melos run test:example:integration:ios
env:
IOS_SMOKE_MAX_ATTEMPTS: "3"
example_windows:
runs-on: windows-latest
needs: [dart_checks, native_windows_checks]
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- run: dart pub global activate melos
- run: melos bootstrap
- name: Build example app (Windows)
run: melos run build:example:windows
- name: Run smoke test (Windows)
run: melos run test:example:integration:windows
example_web:
runs-on: ubuntu-latest
needs: dart_checks
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- run: dart pub global activate melos
- run: melos bootstrap
- name: Build example app (Web)
run: melos run build:example:web
- name: Run smoke test (Web Chrome)
run: melos run test:example:integration:web