Files
neomovies-mobile/.github/workflows/test.yml
factory-droid[bot] 39f311d02e fix: Improve GitHub Actions workflows and add comprehensive tests
GitHub Actions improvements:
- Fix release workflow to prevent draft releases on new workflow runs
- Add automatic deletion of previous releases with same tag
- Improve test workflow with torrent-engine-downloads branch support
- Update Flutter version and add code generation step
- Add Android lint checks and debug APK builds
- Remove emoji from all workflow outputs for cleaner logs
- Add make_latest flag for proper release versioning

Test improvements:
- Add comprehensive unit tests for TorrentInfo model
- Add tests for FilePriority enum with comparison operators
- Add DownloadsProvider tests for utility methods
- Add widget tests for UI components and interactions
- Test video file detection and main file selection
- Test torrent state detection (downloading, paused, completed)
- Test byte formatting for file sizes and speeds

All tests validate the torrent downloads functionality
and ensure proper integration with Android engine.
2025-10-03 07:07:15 +00:00

141 lines
3.2 KiB
YAML

name: Test and Analyze
on:
push:
branches:
- main
- dev
- 'feature/**'
- 'torrent-engine-downloads'
pull_request:
branches:
- main
- dev
jobs:
flutter-analyze:
name: Flutter Analyze
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.19.6'
channel: 'stable'
cache: true
- name: Get dependencies
run: flutter pub get
- name: Run code generation
run: |
dart run build_runner build --delete-conflicting-outputs || true
- name: Run Flutter Analyze
run: flutter analyze --no-fatal-infos
- name: Check formatting
run: dart format --set-exit-if-changed .
flutter-test:
name: Flutter Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.35.5'
channel: 'stable'
cache: true
- name: Get dependencies
run: flutter pub get
- name: Run tests
run: flutter test --coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage/lcov.info
fail_ci_if_error: false
if: always()
android-lint:
name: Android Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.35.5'
channel: 'stable'
cache: true
- name: Get dependencies
run: flutter pub get
- name: Run Android Lint
run: |
cd android
chmod +x gradlew
./gradlew lint
- name: Upload lint reports
uses: actions/upload-artifact@v4
with:
name: android-lint-reports
path: |
android/app/build/reports/lint-*.html
android/torrentengine/build/reports/lint-*.html
retention-days: 7
if: always()
build-debug:
name: Build Debug APK
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/dev'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.35.5'
channel: 'stable'
cache: true
- name: Get dependencies
run: flutter pub get
- name: Build Debug APK
run: flutter build apk --debug
- name: Upload Debug APK
uses: actions/upload-artifact@v4
with:
name: apk-debug
path: build/app/outputs/flutter-apk/app-debug.apk
retention-days: 7