Add integration test #133
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nextbillion Navigation Flutter CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Setup Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: "3.22.0" | ||
- name: Install dependencies | ||
run: flutter pub get | ||
- name: Run analyzer | ||
run: flutter analyze lib | ||
- name: Run tests with coverage | ||
run: | | ||
flutter test --coverage | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
files: coverage/lcov.info | ||
flags: unittests | ||
name: codecov-report | ||
fail_ci_if_error: true | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
drive_android: | ||
runs-on: macos-latest | ||
strategy: | ||
matrix: | ||
api-level: [33] | ||
target: [google_apis] | ||
arch: [arm64-v8a] # Use ARM architecture for compatibility | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "oracle" | ||
java-version: "17" | ||
- name: Setup Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: "3.22.0" | ||
channel: "stable" | ||
architecture: x64 | ||
- name: Run Flutter Driver tests | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
with: | ||
api-level: ${{ matrix.api-level }} | ||
target: ${{ matrix.target }} | ||
arch: ${{ matrix.arch }} # Use ARM architecture | ||
profile: Nexus 6 | ||
script: | | ||
cd .. | ||
cd .. | ||
cd example/ | ||
flutter pub get | ||
flutter drive --driver=test_driver/integration_test.dart --target=integration_test/app_test.dart |