Files
IKAR/.github/workflows/flutter-main.yml
T

169 lines
4.5 KiB
YAML

name: Flutter Main CI
on:
pull_request:
branches:
- 'main'
jobs:
android:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.44.3'
channel: 'stable'
cache: true
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
targets: aarch64-linux-android,armv7-linux-androideabi,x86_64-linux-android
- name: Install dependencies
run: flutter pub get
- name: Verify formatting
run: dart format --output=none --set-exit-if-changed lib test
- name: Flutter analyze
run: flutter analyze --no-fatal-infos lib test
- name: Install native plugin build dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libclang-dev
- name: Prepare native plugin runtime for tests
run: dart run tool/prepare_plugin_runtime.dart
- name: Build E2EE test library
uses: ./.github/actions/setup-e2ee
- name: Build native crypto test library
run: cargo build --locked --manifest-path native/qlyra_crypto/rust/Cargo.toml
- name: Flutter tests with coverage
run: flutter test --coverage
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: flutter-main-coverage
path: coverage/lcov.info
if-no-files-found: error
- name: Configure Gradle
run: |
mkdir -p ~/.gradle
echo "org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=1024m" >> ~/.gradle/gradle.properties
echo "kotlin.daemon.jvmargs=-Xmx1536m" >> ~/.gradle/gradle.properties
echo "org.gradle.caching=true" >> ~/.gradle/gradle.properties
echo "org.gradle.parallel=true" >> ~/.gradle/gradle.properties
echo "org.gradle.configureondemand=true" >> ~/.gradle/gradle.properties
- name: Build debug APK
run: flutter build apk --debug --flavor qlyra
linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.44.3'
channel: 'stable'
- name: Install Linux desktop dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev libsecret-1-dev libjsoncpp-dev
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
targets: x86_64-unknown-linux-gnu
- name: Install dependencies
run: flutter pub get
- name: Build Linux
run: flutter build linux --release
windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.44.3'
channel: 'stable'
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
targets: x86_64-pc-windows-msvc
- name: Install dependencies
run: flutter pub get
- name: Build Windows
run: flutter build windows --release
apple:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.44.3'
channel: 'stable'
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
targets: aarch64-apple-ios,aarch64-apple-ios-sim,x86_64-apple-ios,aarch64-apple-darwin,x86_64-apple-darwin
- name: Install dependencies
run: flutter pub get
- name: Build iOS
run: |
flutter config --no-enable-swift-package-manager
flutter build ios --release --no-codesign
- name: Fix ogg_opus_player macOS libs
run: ./scripts/fix_opus_macos.sh
- name: Build macOS
run: flutter build macos --release