132 lines
3.7 KiB
YAML
132 lines
3.7 KiB
YAML
name: Flutter Dev CI
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- 'dev/**'
|
|
|
|
jobs:
|
|
analyze-and-build-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-dev-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
|
|
|
|
build-ios:
|
|
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'
|
|
cache: true
|
|
|
|
- name: Setup Rust
|
|
uses: ./.github/actions/setup-rust
|
|
with:
|
|
targets: aarch64-apple-ios,aarch64-apple-ios-sim,x86_64-apple-ios
|
|
|
|
- name: Install dependencies
|
|
run: flutter pub get
|
|
|
|
- name: Verify formatting
|
|
run: dart format --output=none --set-exit-if-changed 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
|
|
run: flutter test
|
|
|
|
- name: Build iOS (no codesign)
|
|
run: |
|
|
flutter config --no-enable-swift-package-manager
|
|
flutter build ios --release --no-codesign
|