-
-
Notifications
You must be signed in to change notification settings - Fork 16
141 lines (119 loc) · 3.85 KB
/
ci.yml
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
131
132
133
134
135
136
137
138
139
140
141
name: CI
on:
push:
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
- name: Cache Flutter SDK
uses: actions/cache@v2
with:
path: /opt/hostedtoolcache/Flutter
key: ${{ runner.os }}-flutter-${{ hashFiles('**/flutter/bin/cache/**') }}
restore-keys: |
${{ runner.os }}-flutter-
- name: Setup Flutter SDK
uses: subosito/flutter-action@v2
with:
channel: beta
- name: Cache Flutter packages
uses: actions/cache@v2
with:
path: ~/.pub-cache
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-pub-
- name: Install packages
run: flutter pub get
- name: Analyze
run: flutter analyze
ios:
strategy:
matrix:
device:
- iPhone 14 Pro Max Simulator
fail-fast: true
runs-on: macos-latest
steps:
- name: List all simulators
run: xcrun xctrace list devices
- name: Start Simulator
run: |
UDID=$(xcrun xctrace list devices | grep "^${{ matrix.device }}" | awk 'NR==1{gsub(/[()]/,""); print $NF}')
echo $UDID
xcrun simctl boot "${UDID:?No Simulator with this name found}"
- name: Check out
uses: actions/checkout@v3
- name: Cache Flutter SDK
uses: actions/cache@v2
with:
path: /opt/hostedtoolcache/Flutter
key: ${{ runner.os }}-flutter-${{ hashFiles('**/flutter/bin/cache/**') }}
restore-keys: |
${{ runner.os }}-flutter-
- name: Setup Flutter SDK
uses: subosito/flutter-action@v2
with:
channel: beta
- name: Cache Flutter packages
uses: actions/cache@v2
with:
path: ~/.pub-cache
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-pub-
- name: Install Flutter dependencies
run: flutter --disable-telemetry && flutter pub get ./example
- name: Run integration tests
run: |
cd example
flutter test integration_test/integration_test.dart
android:
runs-on: macos-latest
strategy:
matrix:
api-level: [31]
target: [google_apis]
fail-fast: true
steps:
- name: Check out
uses: actions/checkout@v3
- name: Cache Flutter SDK
uses: actions/cache@v2
with:
path: /opt/hostedtoolcache/Flutter
key: ${{ runner.os }}-flutter-${{ hashFiles('**/flutter/bin/cache/**') }}
restore-keys: |
${{ runner.os }}-flutter-
- name: Setup Flutter SDK
uses: subosito/flutter-action@v2
with:
channel: beta
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: 11
distribution: adopt
cache: gradle
- name: Cache Flutter packages
uses: actions/cache@v2
with:
path: ~/.pub-cache
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-pub-
- name: Install Flutter dependencies
run: flutter --disable-telemetry && flutter pub get ./example
# More info on https://github.com/ReactiveCircus/android-emulator-runner
- name: Run integration tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim
working-directory: ./example
script: |
echo ANDROID_EMULATOR_WAIT_TIME_BEFORE_KILL=600 >> $GITHUB_ENV
flutter test integration_test/integration_test.dart