-
Notifications
You must be signed in to change notification settings - Fork 12
72 lines (65 loc) · 2.15 KB
/
integration_tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Integration Tests
run-name: ${{ github.actor }} is testing the app
on:
workflow_dispatch:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
branches:
- 'main'
- 'pre-release'
paths-ignore:
- '**.md'
- '**.yaml'
- 'doc/**'
- '.git/'
- '.vscode/'
jobs:
Build:
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: Set permissions
# run: |
# adb -s emulator-5554 root
# adb -s emulator-5554 shell "echo '<permission name="android.permission.SCHEDULE_EXACT_ALARM" granted="true" package="com.codepup.workout_timer" />' >> /data/system/permissions.xml"
- 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: Upload screenshots
# if: always()
# uses: actions/upload-artifact@v3
# with:
# name: integration-test-screenshots
# path: screenshots/