Skip to content

Commit

Permalink
Test pre building apk
Browse files Browse the repository at this point in the history
  • Loading branch information
a-mabe committed Jan 2, 2025
1 parent 7c02d13 commit bad2c5b
Showing 1 changed file with 97 additions and 67 deletions.
164 changes: 97 additions & 67 deletions .github/workflows/integration_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,81 +23,106 @@ on:
- 'ios/**'

jobs:
Workout:

build:
name: Build Debug APK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
java-version: '17'
distribution: 'temurin'
- uses: subosito/flutter-action@v2
flutter-version: stable

- name: Install dependencies
run: flutter pub get

- name: Build debug APK
run: flutter build apk --debug

- name: Upload APK as artifact
uses: actions/upload-artifact@v3
with:
channel: 'stable'
- name: Check Version
run: flutter --version
- name: Flutter Doctor
run: flutter doctor -v
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
name: debug-apk
path: build/app/outputs/flutter-apk/app-debug.apk

- name: Setup Android SDK
uses: android-actions/setup-android@v3
# Workout:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Set up JDK 17
# uses: actions/setup-java@v3
# with:
# java-version: '17'
# distribution: 'temurin'
# - uses: subosito/flutter-action@v2
# with:
# channel: 'stable'
# - name: Check Version
# run: flutter --version
# - name: Flutter Doctor
# run: flutter doctor -v
# - name: Enable KVM
# run: |
# echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
# sudo udevadm control --reload-rules
# sudo udevadm trigger --name-match=kvm

# - name: Setup Android SDK
# uses: android-actions/setup-android@v3

- name: run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 35
arch: x86_64
script: |
# Build the APK
flutter build apk --debug
adb -s emulator-5554 install build/app/outputs/flutter-apk/app-debug.apk
adb -s emulator-5554 root
adb -s emulator-5554 shell appops set com.codepup.workout_timer SCHEDULE_EXACT_ALARM allow
flutter drive -d emulator-5554 --driver=test_driver/integration_test.dart --target=integration_test/workout_test.dart
# - name: run tests
# uses: reactivecircus/android-emulator-runner@v2
# with:
# api-level: 35
# arch: x86_64
# script: |
# # Build the APK
# flutter build apk --debug
# adb -s emulator-5554 install build/app/outputs/flutter-apk/app-debug.apk
# adb -s emulator-5554 root
# adb -s emulator-5554 shell appops set com.codepup.workout_timer SCHEDULE_EXACT_ALARM allow
# flutter drive -d emulator-5554 --driver=test_driver/integration_test.dart --target=integration_test/workout_test.dart

Timer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Check Version
run: flutter --version
- name: Flutter Doctor
run: flutter doctor -v
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
# Timer:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Set up JDK 17
# uses: actions/setup-java@v3
# with:
# java-version: '17'
# distribution: 'temurin'
# - uses: subosito/flutter-action@v2
# with:
# channel: 'stable'
# - name: Check Version
# run: flutter --version
# - name: Flutter Doctor
# run: flutter doctor -v
# - name: Enable KVM
# run: |
# echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
# sudo udevadm control --reload-rules
# sudo udevadm trigger --name-match=kvm

- name: Setup Android SDK
uses: android-actions/setup-android@v3
# - name: Setup Android SDK
# uses: android-actions/setup-android@v3

- name: run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 35
arch: x86_64
script: |
# Build the APK
flutter build apk --debug
adb -s emulator-5554 install build/app/outputs/flutter-apk/app-debug.apk
adb -s emulator-5554 root
adb -s emulator-5554 shell appops set com.codepup.workout_timer SCHEDULE_EXACT_ALARM allow
flutter drive -d emulator-5554 --driver=test_driver/integration_test.dart --target=integration_test/timer_test.dart
# - name: run tests
# uses: reactivecircus/android-emulator-runner@v2
# with:
# api-level: 35
# arch: x86_64
# script: |
# # Build the APK
# flutter build apk --debug
# adb -s emulator-5554 install build/app/outputs/flutter-apk/app-debug.apk
# adb -s emulator-5554 root
# adb -s emulator-5554 shell appops set com.codepup.workout_timer SCHEDULE_EXACT_ALARM allow
# flutter drive -d emulator-5554 --driver=test_driver/integration_test.dart --target=integration_test/timer_test.dart

General:
runs-on: ubuntu-latest
Expand All @@ -115,6 +140,11 @@ jobs:
run: flutter --version
- name: Flutter Doctor
run: flutter doctor -v
- name: Download APK artifact
uses: actions/download-artifact@v3
with:
name: debug-apk
path: build/app/outputs/flutter-apk/
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
Expand All @@ -135,4 +165,4 @@ jobs:
adb -s emulator-5554 install build/app/outputs/flutter-apk/app-debug.apk
adb -s emulator-5554 root
adb -s emulator-5554 shell appops set com.codepup.workout_timer SCHEDULE_EXACT_ALARM allow
flutter drive -d emulator-5554 --driver=test_driver/integration_test.dart --target=integration_test/general_test.dart
flutter drive -d emulator-5554 --driver=test_driver/integration_test.dart --target=integration_test/general_test.dart --use-application-binary=build/app/outputs/flutter-apk/app-debug.apk

0 comments on commit bad2c5b

Please sign in to comment.