Skip to content

Commit 333d36b

Browse files
authored
ci: update tests scripts and fix ci issues (#262)
* chore: update patrol and patrol_cli * ci: update flutter and dart version to support latest patrol * fix: deprecated color methods * Select Xcode version 16.2 in CI * Add ability to give TEST_OS env parameter for ios unit tests * Use XCode 16.1 instead of XCode 16.2
1 parent bf991ee commit 333d36b

File tree

19 files changed

+112
-76
lines changed

19 files changed

+112
-76
lines changed

.github/workflows/analyze.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ jobs:
3131
- name: Checkout code
3232
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
3333
- name: Setup flutter
34-
uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
34+
uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff
3535
with:
36-
flutter-version: "3.22.x"
36+
flutter-version: "3.27.x"
3737
channel: "stable"
3838
cache: true
3939
- name: Setup melos
@@ -55,9 +55,9 @@ jobs:
5555
distribution: "temurin"
5656
java-version: "17"
5757
- name: Setup flutter
58-
uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
58+
uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff
5959
with:
60-
flutter-version: "3.22.x"
60+
flutter-version: "3.27.x"
6161
channel: "stable"
6262
cache: true
6363
- name: Setup melos

.github/workflows/licence-check.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ jobs:
3939
- name: Run addlicense
4040
run: go install github.com/google/addlicense@latest
4141
- name: Install Flutter
42-
uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
42+
uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff
4343
with:
44-
flutter-version: "3.22.x"
44+
flutter-version: "3.27.x"
4545
channel: "stable"
4646
cache: true
4747
- name: Install Melos

.github/workflows/test-and-build.yaml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ jobs:
3838
distribution: "temurin"
3939
java-version: "17"
4040
cache: "gradle"
41-
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
41+
- uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff
4242
name: Setup flutter
4343
with:
44-
flutter-version: "3.22.x"
44+
flutter-version: "3.27.x"
4545
channel: "stable"
4646
cache: true
4747
- uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388
@@ -65,9 +65,9 @@ jobs:
6565
java-version: "17"
6666
cache: "gradle"
6767
- name: Setup flutter
68-
uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
68+
uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff
6969
with:
70-
flutter-version: "3.22.x"
70+
flutter-version: "3.27.x"
7171
channel: "stable"
7272
cache: true
7373
- name: Setup melos
@@ -95,9 +95,9 @@ jobs:
9595
- name: Checkout code
9696
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
9797
- name: Setup flutter
98-
uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
98+
uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff
9999
with:
100-
flutter-version: "3.22.x"
100+
flutter-version: "3.27.x"
101101
channel: "stable"
102102
cache: true
103103
- name: Setup melos
@@ -111,13 +111,13 @@ jobs:
111111
key: ${{ runner.os }}-pods-${{ hashFiles('**/*.podspec') }}
112112
restore-keys: |
113113
${{ runner.os }}-pods-
114-
- name: Select XCode 16.0
115-
run: sudo xcode-select -s '/Applications/Xcode_16.app/Contents/Developer'
114+
- name: Select XCode 16.1
115+
run: sudo xcode-select -s '/Applications/Xcode_16.1.0.app/Contents/Developer'
116116
- name: Generate necessary files with flutter build
117117
working-directory: ${{ env.working_directory }}
118118
run: flutter build ios --config-only
119119
- name: "Run iOS native unit tests"
120-
run: DEVICE='iPhone 16 Pro' melos run test:ios
120+
run: TEST_DEVICE='iPhone 16 Pro' TEST_OS='18.1' melos run test:ios
121121
- name: Upload build artifact
122122
uses: actions/upload-artifact@v4
123123
with:
@@ -145,9 +145,9 @@ jobs:
145145
java-version: "17"
146146
cache: "gradle"
147147
- name: Setup flutter
148-
uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
148+
uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff
149149
with:
150-
flutter-version: "3.22.x"
150+
flutter-version: "3.27.x"
151151
channel: "stable"
152152
cache: true
153153
- name: Setup melos
@@ -182,9 +182,9 @@ jobs:
182182
- name: Checkout code
183183
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
184184
- name: Setup flutter
185-
uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
185+
uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff
186186
with:
187-
flutter-version: "3.22.x"
187+
flutter-version: "3.27.x"
188188
channel: "stable"
189189
cache: true
190190
architecture: x64
@@ -203,8 +203,8 @@ jobs:
203203
uses: actions/download-artifact@v4
204204
with:
205205
name: ${{ runner.os }}-build-artifact
206-
- name: Select XCode 16.0
207-
run: sudo xcode-select -s '/Applications/Xcode_16.app/Contents/Developer'
206+
- name: Select XCode 16.1
207+
run: sudo xcode-select -s '/Applications/Xcode_16.1.0.app/Contents/Developer'
208208
- name: "Run build for iOS"
209209
run: melos run flutter-build-ios
210210
- name: Upload build artifact
@@ -225,7 +225,7 @@ jobs:
225225
labels: ubuntu-latest
226226
env:
227227
MAPS_API_KEY: ${{ secrets.ACTIONS_API_KEY }}
228-
patrol_cli_version: "3.2.0"
228+
patrol_cli_version: "3.5.0"
229229
working_directory: "example"
230230
steps:
231231
- name: Fail if workflow has no access to API key
@@ -257,9 +257,9 @@ jobs:
257257
~/.android/adb*
258258
key: avd
259259
- name: Setup flutter
260-
uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
260+
uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff
261261
with:
262-
flutter-version: "3.22.x"
262+
flutter-version: "3.27.x"
263263
channel: "stable"
264264
cache: true
265265
- name: Download Build Artifact
@@ -312,7 +312,7 @@ jobs:
312312
labels: macos-latest-xlarge
313313
env:
314314
MAPS_API_KEY: ${{ secrets.ACTIONS_API_KEY }}
315-
patrol_cli_version: "3.2.0"
315+
patrol_cli_version: "3.5.0"
316316
working_directory: "example"
317317
steps:
318318
- name: Fail if workflow has no access to API key
@@ -323,13 +323,13 @@ jobs:
323323
- name: Checkout code
324324
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
325325
- name: Setup flutter
326-
uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
326+
uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff
327327
with:
328-
flutter-version: "3.22.x"
328+
flutter-version: "3.27.x"
329329
channel: "stable"
330330
cache: true
331-
- name: Select XCode 16.0
332-
run: sudo xcode-select -s '/Applications/Xcode_16.app/Contents/Developer'
331+
- name: Select XCode 16.1
332+
run: sudo xcode-select -s '/Applications/Xcode_16.1.0.app/Contents/Developer'
333333
- name: Start iOS simulator
334334
run: |
335335
SIMULATOR_NAME="iPhone 16 Pro"

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ To run unit tests on iOS, follow these steps:
122122
Or to run the iOS unit tests from command line, call
123123

124124
```bash
125-
DEVICE='iPhone 15' melos run ios:test
125+
TEST_DEVICE='iPhone 16 Pro' TEST_OS="18.1" melos run test:ios
126126
```
127127

128128
Specify the device you want to run the tests on with the DEVICE env variable.
@@ -132,7 +132,7 @@ Specify the device you want to run the tests on with the DEVICE env variable.
132132
Integration tests are responsible for ensuring that the plugin works against the native Navigation SDK for both Android and iOS platforms. Patrol is used for the integration tests to simplify interactions with native elements. To use patrol, you first need to activate the patrol_cli.
133133

134134
```bash
135-
flutter pub global activate patrol_cli 3.2.0
135+
flutter pub global activate patrol_cli 3.5.0
136136
```
137137

138138
To ensure that all necessary dependencies for patrol are properly set up, run the following command:

example/integration_test/t08_marker_polygon_polyline_circle_test.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ void main() {
308308
polylines[0]!.options.points![1].longitude, closeTo(25.929471, 0.01));
309309
expect(polylines[0]!.options.clickable, true);
310310
expect(polylines[0]!.options.geodesic, true);
311-
expect(polylines[0]!.options.strokeColor!.value, Colors.red.value);
311+
expect(polylines[0]!.options.strokeColor!, Colors.red);
312312
expect(polylines[0]!.options.strokeWidth, 5.0);
313313

314314
/// iOS doesn't have strokeJointTypes
@@ -343,8 +343,7 @@ void main() {
343343
expect(receivedPolylines.length, 1);
344344
expect(receivedPolylines[0]!.options.geodesic, false);
345345
expect(receivedPolylines[0]!.options.clickable, false);
346-
expect(
347-
receivedPolylines[0]!.options.strokeColor!.value, Colors.black.value);
346+
expect(receivedPolylines[0]!.options.strokeColor!, Colors.black);
348347
expect(receivedPolylines[0]!.options.strokeWidth, 10.0);
349348

350349
/// iOS doesn't have strokeJointTypes

example/lib/pages/circles.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class _CirclesPageState extends ExamplePageState<CirclesPage> {
141141
Future<void> _setFillColor() async {
142142
final Color oldColor = _selectedCircle!.options.fillColor;
143143
final Color newColor = _colors.elementAtOrNull(
144-
_colors.indexWhere((Color e) => e.value == oldColor.value) + 1) ??
144+
_colors.indexWhere((Color e) => e == oldColor) + 1) ??
145145
_colors[0];
146146

147147
await _updateSelectedCircleWithOptions(
@@ -151,21 +151,21 @@ class _CirclesPageState extends ExamplePageState<CirclesPage> {
151151
Future<void> _setStrokeColor() async {
152152
final Color oldColor = _selectedCircle!.options.strokeColor;
153153
final Color newColor = _colors.elementAtOrNull(
154-
_colors.indexWhere((Color e) => e.value == oldColor.value) + 1) ??
154+
_colors.indexWhere((Color e) => e == oldColor) + 1) ??
155155
_colors[0];
156156

157157
await _updateSelectedCircleWithOptions(
158158
_selectedCircle!.options.copyWith(strokeColor: newColor));
159159
}
160160

161161
String _colorName(Color? color) {
162-
if (color?.value == Colors.black.value) {
162+
if (color == Colors.black) {
163163
return 'Black';
164-
} else if (color?.value == Colors.red.value) {
164+
} else if (color == Colors.red) {
165165
return 'Red';
166-
} else if (color?.value == Colors.green.value) {
166+
} else if (color == Colors.green) {
167167
return 'Green';
168-
} else if (color?.value == Colors.blue.value) {
168+
} else if (color == Colors.blue) {
169169
return 'Blue';
170170
} else {
171171
return 'null';

example/lib/pages/polygons.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class _PolygonsPageState extends ExamplePageState<PolygonsPage> {
187187
Future<void> _setFillColor() async {
188188
final Color oldColor = _selectedPolygon!.options.fillColor;
189189
final Color newColor = _colors.elementAtOrNull(
190-
_colors.indexWhere((Color e) => e.value == oldColor.value) + 1) ??
190+
_colors.indexWhere((Color e) => e == oldColor) + 1) ??
191191
_colors[0];
192192

193193
await _updateSelectedPolygonWithOptions(
@@ -197,21 +197,21 @@ class _PolygonsPageState extends ExamplePageState<PolygonsPage> {
197197
Future<void> _setStrokeColor() async {
198198
final Color oldColor = _selectedPolygon!.options.strokeColor;
199199
final Color newColor = _colors.elementAtOrNull(
200-
_colors.indexWhere((Color e) => e.value == oldColor.value) + 1) ??
200+
_colors.indexWhere((Color e) => e == oldColor) + 1) ??
201201
_colors[0];
202202

203203
await _updateSelectedPolygonWithOptions(
204204
_selectedPolygon!.options.copyWith(strokeColor: newColor));
205205
}
206206

207207
String _colorName(Color? color) {
208-
if (color?.value == Colors.black.value) {
208+
if (color == Colors.black) {
209209
return 'Black';
210-
} else if (color?.value == Colors.red.value) {
210+
} else if (color == Colors.red) {
211211
return 'Red';
212-
} else if (color?.value == Colors.green.value) {
212+
} else if (color == Colors.green) {
213213
return 'Green';
214-
} else if (color?.value == Colors.blue.value) {
214+
} else if (color == Colors.blue) {
215215
return 'Blue';
216216
} else {
217217
return 'null';

example/lib/pages/polylines.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class _PolylinesPageState extends ExamplePageState<PolylinesPage> {
143143
Future<void> _setStrokeColor() async {
144144
final Color oldColor = _selectedPolyline!.options.strokeColor!;
145145
final Color newColor = _colors.elementAtOrNull(
146-
_colors.indexWhere((Color e) => e.value == oldColor.value) + 1) ??
146+
_colors.indexWhere((Color e) => e == oldColor) + 1) ??
147147
_colors[0];
148148

149149
await _updateSelectedPolylineWithOptions(
@@ -159,13 +159,13 @@ class _PolylinesPageState extends ExamplePageState<PolylinesPage> {
159159
}
160160

161161
String _colorName(Color? color) {
162-
if (color?.value == Colors.black.value) {
162+
if (color == Colors.black) {
163163
return 'Black';
164-
} else if (color?.value == Colors.red.value) {
164+
} else if (color == Colors.red) {
165165
return 'Red';
166-
} else if (color?.value == Colors.green.value) {
166+
} else if (color == Colors.green) {
167167
return 'Green';
168-
} else if (color?.value == Colors.blue.value) {
168+
} else if (color == Colors.blue) {
169169
return 'Blue';
170170
} else {
171171
return 'null';

example/lib/widgets/page.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ abstract class ExamplePageState<T extends ExamplePage> extends State<T>
118118
child: AnimatedBuilder(
119119
animation: _controller,
120120
builder: (BuildContext context, Widget? child) => Container(
121-
color: Colors.black.withOpacity(_controller.value * 0.5)))),
121+
color: Colors.black.withAlpha(
122+
(255.0 * _controller.value * 0.5).round())))),
122123
// Overlay content
123124
SlideTransition(
124125
position: _overlayOffsetAnimation,

example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dev_dependencies:
3636
integration_test:
3737
sdk: flutter
3838
meta: any
39-
patrol: ">=3.11.0 <3.12.0"
39+
patrol: ^3.14.0
4040
pub_semver: ^2.1.4
4141
test_api: any
4242

0 commit comments

Comments
 (0)