@@ -2,9 +2,10 @@ version: 2.1
22
33orbs :
44 android : circleci/android@2.5.0
5- flutter : circleci/flutter@2.0.2
5+ flutter : circleci/flutter@2.1.0
66 node : circleci/node@5.2.0
77 advanced-checkout : vsco/advanced-checkout@1.1.0
8+ ios : circleci/macos@2.5.4
89
910commands :
1011 setup_flutter :
@@ -17,79 +18,55 @@ commands:
1718 setup_ios :
1819 steps :
1920 # Flutter doesn't support Apple Silicon yet, so we need to install Rosetta use Flutter on M1 machines.
20- - run :
21- name : Install Rosetta
22- command : softwareupdate --install-rosetta --agree-to-license
21+ - ios/install-rosetta
2322 - setup_flutter
2423 - run :
2524 name : Install CocoaPods
2625 command : sudo gem install cocoapods
27- - run :
28- name : Install Pods
29- working_directory : example/ios
30- command : pod install --repo-update
31- setup_captain :
32- parameters :
33- platform :
34- type : enum
35- enum :
36- - ios
37- - android
26+ - flutter/install_ios_pod :
27+ app-dir : example
28+ repo-update : true
29+ setup_patrol :
3830 steps :
3931 - run :
40- name : Install Appium
41- command : npm install -g appium
42- - when :
43- condition :
44- equal :
45- - <<parameters.platform>>
46- - ios
47- steps :
48- - run :
49- name : Install XCUITest Driver
50- command : appium driver install xcuitest@4.35.0
51- - when :
52- condition :
53- equal :
54- - <<parameters.platform>>
55- - android
56- steps :
57- - run :
58- name : Install UIAutomator2 Driver
59- command : appium driver install uiautomator2@3.1.0
60- - run :
61- name : Launch Appium
62- # Enable --relaxed-security for `mobile: shell` command that Captain uses internally.
63- command : appium --relaxed-security
64- background : true
65- - run :
66- name : Install .NET 6
67- command : curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 6.0.1xx
68- - run :
69- name : Add .NET to PATH
32+ name : Add pub-cache bin to PATH
7033 command : |
71- echo 'export DOTNET_ROOT=$ HOME/.dotnet ' >> $BASH_ENV
72- echo 'export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools' >> $BASH_ENV
34+ echo 'export PATH="$PATH:$ HOME/.pub-cache/bin" ' >> $BASH_ENV
35+ source $BASH_ENV
7336 - run :
74- name : Clone Captain
75- command : git clone git@github.com:Instabug/Captain.git ../Instabug.Captain
76- - run :
77- name : Configure Captain Platform
78- command : echo 'export CAPTAIN_PLATFORM=<<parameters.platform>>' >> $BASH_ENV
37+ name : Install patrol
38+ command : dart pub global activate patrol_cli 3.5.0
7939 # This runs `flutter pub get` and `dart pub get` if we pass parameter `generate_pigeons` to the job it also runs the following:
8040 # - `sh ./scripts/pigeon.sh`
8141 # - `dart run build_runner build --delete-conflicting-outputs`
8242 install_flutter_and_dart_packages :
8343 parameters :
8444 generate_pigeons :
8545 type : boolean
46+ remove_patrol :
47+ type : boolean
48+ default : false
49+ version :
50+ type : string
51+ default : " 3.24.0"
8652 steps :
53+ - flutter/install_sdk :
54+ version : <<parameters.version>>
55+ - when :
56+ condition :
57+ equal :
58+ - <<parameters.remove_patrol>>
59+ - true
60+ steps :
61+ - run :
62+ name : remove Patrol
63+ command : cd example && dart pub remove patrol
8764 - run :
8865 name : Install Flutter Packages
89- command : flutter pub get
66+ command : flutter pub get --verbose
9067 - run :
9168 name : Install Dart Packages
92- command : dart pub get
69+ command : dart pub get --verbose
9370 description : Install Dart Packages (for dart explicit packages)
9471 - when :
9572 condition :
@@ -123,12 +100,21 @@ jobs:
123100 parameters :
124101 version :
125102 type : string
126- docker :
127- - image : cirrusci/flutter:<<parameters.version>>
103+ executor :
104+ name : android/android-machine
105+ resource-class : xlarge
106+ tag : 2024.01.1
128107 steps :
129108 - advanced-checkout/shallow-checkout
130109 - install_flutter_and_dart_packages :
131110 generate_pigeons : true
111+ remove_patrol : true
112+ version : <<parameters.version>>
113+ - run :
114+ name : Install lcov
115+ command : |
116+ sudo apt-get update
117+ sudo apt-get install -y lcov
132118 - run : flutter test --coverage
133119 - run :
134120 working_directory : coverage
@@ -150,26 +136,31 @@ jobs:
150136 working-directory : example/android
151137 test-command : ./gradlew test
152138
153- e2e_android_captain :
139+ e2e_android_patrol :
154140 executor :
155141 name : android/android-machine
156142 resource-class : xlarge
157143 tag : 2024.01.1
158144 steps :
159145 - advanced-checkout/shallow-checkout
160- - setup_captain :
161- platform : android
162146 - setup_flutter
163- - android/start-emulator-and-run-tests :
164- run-tests-working-directory : e2e
165- additional-avd-args : --device 3
147+ - setup_patrol
148+ - android/create-avd :
149+ avd-name : ' test'
150+ install : true
166151 system-image : system-images;android-33;default;x86_64
167- post-emulator-launch-assemble-command : cd example && flutter build apk --debug
168- test-command : dotnet test
152+ - android/start-emulator :
153+ avd-name : ' test'
154+ post-emulator-launch-assemble-command : " "
155+ - run :
156+ name : Run E2E Tests
157+ no_output_timeout : 30m
158+ working_directory : example
159+ command : patrol test -t integration_test/
169160
170161 test_ios :
171162 macos :
172- xcode : 15.2 .0
163+ xcode : 16.0 .0
173164 resource_class : macos.m1.medium.gen1
174165 environment :
175166 INSTABUG_SOURCEMAPS_UPLOAD_DISABLE : true
@@ -185,31 +176,37 @@ jobs:
185176 -scheme Runner \
186177 -resultBundlePath coverage/result.xcresult \
187178 -sdk iphonesimulator \
188- -destination 'platform=iOS Simulator,name=iPhone 15 Pro Max,OS=17.2' \
179+ -destination 'platform=iOS Simulator,name=iPhone 16 Pro Max,OS=18.0' \
180+ -skip-testing:RunnerUITests \
189181 test | xcpretty
190182
191- e2e_ios_captain :
183+ e2e_ios_patrol :
192184 macos :
193- xcode : 15.2 .0
185+ xcode : 16.0 .0
194186 resource_class : macos.m1.medium.gen1
195187 steps :
196188 - advanced-checkout/shallow-checkout
197- - setup_captain :
198- platform : ios
199189 - setup_ios
190+ - setup_patrol
191+ - ios/preboot-simulator :
192+ version : " 18.0"
193+ device : " iPhone 16 Pro"
194+ - ios/wait-until-simulator-booted
195+ - ios/wait-until-simulator-booted
200196 - run :
201- name : Build Example App
202- working_directory : example
203- command : flutter build ios --simulator
197+ name : sleep 10 seconds
198+ command : sleep 10
199+
204200 - run :
205201 name : Run E2E Tests
206202 no_output_timeout : 30m
207- working_directory : e2e
208- command : dotnet test
209-
203+ working_directory : example
204+ command : patrol test -t integration_test/ --verbose
210205 format_flutter :
211- docker :
212- - image : cirrusci/flutter
206+ executor :
207+ name : android/android-machine
208+ resource-class : xlarge
209+ tag : 2024.01.1
213210 steps :
214211 - advanced-checkout/shallow-checkout
215212 - install_flutter_and_dart_packages :
@@ -219,8 +216,10 @@ jobs:
219216 command : dart format . --set-exit-if-changed
220217
221218 lint_flutter :
222- docker :
223- - image : cirrusci/flutter
219+ executor :
220+ name : android/android-machine
221+ resource-class : xlarge
222+ tag : 2024.01.1
224223 steps :
225224 - advanced-checkout/shallow-checkout
226225 - install_flutter_and_dart_packages :
@@ -230,8 +229,10 @@ jobs:
230229 command : flutter analyze
231230
232231 verify_pub :
233- docker :
234- - image : cirrusci/flutter
232+ executor :
233+ name : android/android-machine
234+ resource-class : xlarge
235+ tag : 2024.01.1
235236 steps :
236237 - advanced-checkout/shallow-checkout
237238 - install_flutter_and_dart_packages :
@@ -243,7 +244,7 @@ jobs:
243244
244245 release :
245246 macos :
246- xcode : 15.2 .0
247+ xcode : 16.0 .0
247248 resource_class : macos.m1.medium.gen1
248249 working_directory : " ~"
249250 steps :
@@ -288,13 +289,13 @@ workflows:
288289 - test_flutter-stable
289290 - test_flutter :
290291 name : test_flutter-stable
291- version : stable
292+ version : 3.24.0
292293 - test_flutter :
293294 name : test_flutter-2.10.5
294295 version : 2.10.5
295- - e2e_android_captain
296+ - e2e_android_patrol
296297 - test_ios
297- - e2e_ios_captain
298+ - e2e_ios_patrol
298299 - format_flutter
299300 - lint_flutter :
300301 requires :
@@ -312,9 +313,9 @@ workflows:
312313 # TODO: Fix the flaky tests and add the following jobs to the dependencies for the release
313314 # The following jobs have been removed while releasing v13.2.0 to avoid delaying the release
314315 # as they were just flaky and the tests pass locally without issues.
315- # - e2e_android_captain
316+ # - e2e_android_patrol
316317 # - test_ios
317- - e2e_ios_captain
318+ - e2e_ios_patrol
318319 - verify_pub
319320 filters :
320321 branches :
0 commit comments