2025-11-16 12:15:21 +00:00
|
|
|
name: Mobile App CI
|
|
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
push:
|
|
|
|
|
branches: [ main, master ]
|
|
|
|
|
paths:
|
|
|
|
|
- 'mnemo_cards/**'
|
|
|
|
|
- 'mnemo_cards_common/**'
|
|
|
|
|
- 'mnemo_cards_frontend_common/**'
|
|
|
|
|
- 'chat/mnemo_cards_chat/**'
|
|
|
|
|
- 'games/packages/**'
|
|
|
|
|
- 'funny_letters/**'
|
|
|
|
|
pull_request:
|
|
|
|
|
branches: [ main, master ]
|
|
|
|
|
paths:
|
|
|
|
|
- 'mnemo_cards/**'
|
|
|
|
|
- 'mnemo_cards_common/**'
|
|
|
|
|
- 'mnemo_cards_frontend_common/**'
|
|
|
|
|
- 'chat/mnemo_cards_chat/**'
|
|
|
|
|
- 'games/packages/**'
|
|
|
|
|
- 'funny_letters/**'
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
test:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
- name: Checkout code
|
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
|
|
- name: Setup Flutter
|
|
|
|
|
uses: subosito/flutter-action@v2
|
|
|
|
|
with:
|
2025-11-19 19:59:53 +00:00
|
|
|
flutter-version: '3.35.5'
|
2025-11-16 12:15:21 +00:00
|
|
|
channel: 'stable'
|
|
|
|
|
|
|
|
|
|
- name: Setup Java
|
|
|
|
|
uses: actions/setup-java@v4
|
|
|
|
|
with:
|
|
|
|
|
distribution: 'temurin'
|
|
|
|
|
java-version: '17'
|
|
|
|
|
|
|
|
|
|
- name: Cache Flutter dependencies
|
|
|
|
|
uses: actions/cache@v4
|
|
|
|
|
with:
|
|
|
|
|
path: |
|
|
|
|
|
~/.pub-cache
|
|
|
|
|
mnemo_cards/.dart_tool
|
|
|
|
|
mnemo_cards_common/.dart_tool
|
|
|
|
|
mnemo_cards_frontend_common/.dart_tool
|
|
|
|
|
chat/mnemo_cards_chat/.dart_tool
|
|
|
|
|
funny_letters/.dart_tool
|
|
|
|
|
key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }}
|
|
|
|
|
restore-keys: |
|
|
|
|
|
${{ runner.os }}-flutter-
|
|
|
|
|
|
|
|
|
|
- name: Install common dependencies
|
|
|
|
|
run: |
|
|
|
|
|
cd mnemo_cards_common
|
|
|
|
|
flutter pub get
|
|
|
|
|
|
|
|
|
|
- name: Install frontend common dependencies
|
|
|
|
|
run: |
|
|
|
|
|
cd mnemo_cards_frontend_common
|
|
|
|
|
flutter pub get
|
|
|
|
|
|
|
|
|
|
- name: Install chat dependencies
|
|
|
|
|
run: |
|
|
|
|
|
cd chat/mnemo_cards_chat
|
|
|
|
|
flutter pub get
|
|
|
|
|
|
|
|
|
|
- name: Install funny letters dependencies
|
|
|
|
|
run: |
|
|
|
|
|
cd funny_letters
|
|
|
|
|
flutter pub get
|
|
|
|
|
|
|
|
|
|
- name: Install mobile app dependencies
|
|
|
|
|
run: |
|
|
|
|
|
cd mnemo_cards
|
|
|
|
|
flutter pub get
|
|
|
|
|
|
|
|
|
|
- name: Run code generation
|
|
|
|
|
run: |
|
|
|
|
|
cd mnemo_cards
|
|
|
|
|
flutter pub run build_runner build --delete-conflicting-outputs
|
|
|
|
|
|
|
|
|
|
- name: Run linting
|
|
|
|
|
run: |
|
|
|
|
|
cd mnemo_cards
|
|
|
|
|
flutter analyze lib/
|
|
|
|
|
flutter format --set-exit-if-changed lib/
|
|
|
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
|
run: |
|
|
|
|
|
cd mnemo_cards
|
|
|
|
|
flutter test --coverage
|
|
|
|
|
|
|
|
|
|
- name: Upload coverage to Codecov
|
|
|
|
|
uses: codecov/codecov-action@v4
|
|
|
|
|
with:
|
|
|
|
|
file: ./mnemo_cards/coverage/lcov.info
|
|
|
|
|
flags: mobile
|
|
|
|
|
name: mobile-coverage
|
|
|
|
|
|
|
|
|
|
build-android:
|
|
|
|
|
needs: test
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
- name: Checkout code
|
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
|
|
- name: Setup Flutter
|
|
|
|
|
uses: subosito/flutter-action@v2
|
|
|
|
|
with:
|
2025-11-19 19:59:53 +00:00
|
|
|
flutter-version: '3.35.5'
|
2025-11-16 12:15:21 +00:00
|
|
|
channel: 'stable'
|
|
|
|
|
|
|
|
|
|
- name: Setup Java
|
|
|
|
|
uses: actions/setup-java@v4
|
|
|
|
|
with:
|
|
|
|
|
distribution: 'temurin'
|
|
|
|
|
java-version: '17'
|
|
|
|
|
|
|
|
|
|
- name: Setup Android SDK
|
|
|
|
|
uses: android-actions/setup-android@v3
|
|
|
|
|
|
|
|
|
|
- name: Cache Flutter dependencies
|
|
|
|
|
uses: actions/cache@v4
|
|
|
|
|
with:
|
|
|
|
|
path: |
|
|
|
|
|
~/.pub-cache
|
|
|
|
|
mnemo_cards/.dart_tool
|
|
|
|
|
mnemo_cards_common/.dart_tool
|
|
|
|
|
mnemo_cards_frontend_common/.dart_tool
|
|
|
|
|
chat/mnemo_cards_chat/.dart_tool
|
|
|
|
|
funny_letters/.dart_tool
|
|
|
|
|
key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }}
|
|
|
|
|
restore-keys: |
|
|
|
|
|
${{ runner.os }}-flutter-
|
|
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
|
run: |
|
|
|
|
|
cd mnemo_cards_common
|
|
|
|
|
flutter pub get
|
|
|
|
|
cd ../mnemo_cards_frontend_common
|
|
|
|
|
flutter pub get
|
|
|
|
|
cd ../chat/mnemo_cards_chat
|
|
|
|
|
flutter pub get
|
|
|
|
|
cd ../funny_letters
|
|
|
|
|
flutter pub get
|
|
|
|
|
cd ../mnemo_cards
|
|
|
|
|
flutter pub get
|
|
|
|
|
|
|
|
|
|
- name: Build Android APK
|
|
|
|
|
run: |
|
|
|
|
|
cd mnemo_cards
|
|
|
|
|
flutter build apk --release
|
|
|
|
|
|
|
|
|
|
- name: Upload Android APK
|
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
|
with:
|
|
|
|
|
name: android-apk
|
|
|
|
|
path: mnemo_cards/build/app/outputs/flutter-apk/app-release.apk
|
|
|
|
|
|
|
|
|
|
build-ios:
|
|
|
|
|
needs: test
|
|
|
|
|
runs-on: macos-latest
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
- name: Checkout code
|
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
|
|
- name: Setup Flutter
|
|
|
|
|
uses: subosito/flutter-action@v2
|
|
|
|
|
with:
|
2025-11-19 19:59:53 +00:00
|
|
|
flutter-version: '3.35.5'
|
2025-11-16 12:15:21 +00:00
|
|
|
channel: 'stable'
|
|
|
|
|
|
|
|
|
|
- name: Cache Flutter dependencies
|
|
|
|
|
uses: actions/cache@v4
|
|
|
|
|
with:
|
|
|
|
|
path: |
|
|
|
|
|
~/.pub-cache
|
|
|
|
|
mnemo_cards/.dart_tool
|
|
|
|
|
mnemo_cards_common/.dart_tool
|
|
|
|
|
mnemo_cards_frontend_common/.dart_tool
|
|
|
|
|
chat/mnemo_cards_chat/.dart_tool
|
|
|
|
|
funny_letters/.dart_tool
|
|
|
|
|
key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }}
|
|
|
|
|
restore-keys: |
|
|
|
|
|
${{ runner.os }}-flutter-
|
|
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
|
run: |
|
|
|
|
|
cd mnemo_cards_common
|
|
|
|
|
flutter pub get
|
|
|
|
|
cd ../mnemo_cards_frontend_common
|
|
|
|
|
flutter pub get
|
|
|
|
|
cd ../chat/mnemo_cards_chat
|
|
|
|
|
flutter pub get
|
|
|
|
|
cd ../funny_letters
|
|
|
|
|
flutter pub get
|
|
|
|
|
cd ../mnemo_cards
|
|
|
|
|
flutter pub get
|
|
|
|
|
|
|
|
|
|
- name: Build iOS
|
|
|
|
|
run: |
|
|
|
|
|
cd mnemo_cards
|
|
|
|
|
flutter build ios --release --no-codesign
|
|
|
|
|
|
|
|
|
|
- name: Upload iOS build
|
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
|
with:
|
|
|
|
|
name: ios-build
|
|
|
|
|
path: mnemo_cards/build/ios/iphoneos/
|