Files
neomovies-mobile/.github/workflows/test.yml
2025-10-02 20:21:50 +00:00

136 lines
3.0 KiB
YAML

name: Test and Analyze
on:
push:
branches:
- main
- dev
- 'feature/**'
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.24.0'
channel: 'stable'
cache: true
- name: Get dependencies
run: flutter pub get
- name: Run Flutter Analyze
run: flutter analyze
- 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.24.0'
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.24.0'
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.24.0'
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