forked from Ignition-World/ignition-pay
-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (115 loc) · 3.86 KB
/
Copy pathintegration-test.yml
File metadata and controls
130 lines (115 loc) · 3.86 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# ---------------------------------------------------------------------------
# Ignition-mobile integration tests
#
# Runs the `integration_test/` bundle on Android (Linux runner via
# reactivecircus/android-emulator-runner) and iOS (macOS runner; iOS
# simulators aren't available on Linux).
#
# Every job installs Flutter, runs `flutter analyze` (catches broken imports
# before the test runner even starts), then drives the suite with
# `flutter test integration_test/app_test.dart --dart-define=SCENARIO=...`.
#
# Trigger:
# - push / pull_request to main & feature branches
# - manual dispatch via the "Run workflow" button
# ---------------------------------------------------------------------------
name: Integration Tests
on:
push:
branches: [main]
paths:
- 'ignition-mobile/integration_test/**'
- 'ignition-mobile/lib/**'
- 'ignition-mobile/pubspec.yaml'
pull_request:
branches: [main]
paths:
- 'ignition-mobile/integration_test/**'
- 'ignition-mobile/lib/**'
- 'ignition-mobile/pubspec.yaml'
workflow_dispatch:
jobs:
android:
name: Android emulator (${{ matrix.scenario }})
runs-on: ubuntu-latest
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
api-level: [33]
arch: [x86_64]
scenario: [app_launch, deep_link, auth_flow, android, all]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.24.5'
- name: Cache Pub
uses: actions/cache@v4
with:
path: |
~/.pub-cache
ignition-mobile/.dart_tool
key: ${{ runner.os }}-pub-${{ hashFiles('ignition-mobile/pubspec.yaml', 'ignition-mobile/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-pub-
- name: Install dependencies
working-directory: ignition-mobile
run: flutter pub get
- name: Analyze
working-directory: ignition-mobile
run: flutter analyze --no-pub
- name: Run integration tests on Android emulator
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: google_apis
arch: ${{ matrix.arch }}
profile: pixel_6
script: |
cd ignition-mobile
flutter test integration_test/app_test.dart \
--dart-define=SCENARIO=${{ matrix.scenario }}
ios:
name: iOS simulator (${{ matrix.scenario }})
runs-on: macos-latest
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
scenario: [app_launch, deep_link, auth_flow, ios, all]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.24.5'
- name: Cache Pub
uses: actions/cache@v4
with:
path: |
~/.pub-cache
ignition-mobile/.dart_tool
key: ${{ runner.os }}-pub-${{ hashFiles('ignition-mobile/pubspec.yaml', 'ignition-mobile/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-pub-
- name: Install dependencies
working-directory: ignition-mobile
run: flutter pub get
- name: Analyze
working-directory: ignition-mobile
run: flutter analyze --no-pub
- name: Boot iOS simulator
run: |
xcrun simctl list devices available | grep -E "iPhone 15 \(" | head -1
xcrun simctl boot "iPhone 15" || true
xcrun simctl bootstatus "iPhone 15" -b
- name: Run integration tests
working-directory: ignition-mobile
run: |
flutter test integration_test/app_test.dart \
-d "iPhone 15" \
--dart-define=SCENARIO=${{ matrix.scenario }}