Build all example projects in CI build smoke test (#35778)
This commit is contained in:
@@ -258,22 +258,25 @@ Future<void> _runToolTests() async {
|
||||
print('${bold}DONE: All tests successful.$reset');
|
||||
}
|
||||
|
||||
/// Verifies that AOT, APK, and IPA (if on macOS) builds of some
|
||||
/// examples apps finish without crashing. It does not actually
|
||||
/// Verifies that AOT, APK, and IPA (if on macOS) builds the
|
||||
/// examples apps without crashing. It does not actually
|
||||
/// launch the apps. That happens later in the devicelab. This is
|
||||
/// just a smoke-test. In particular, this will verify we can build
|
||||
/// when there are spaces in the path name for the Flutter SDK and
|
||||
/// target app.
|
||||
Future<void> _runBuildTests() async {
|
||||
final List<String> paths = <String>[
|
||||
path.join('examples', 'hello_world'),
|
||||
path.join('examples', 'flutter_gallery'),
|
||||
path.join('examples', 'flutter_view'),
|
||||
];
|
||||
for (String path in paths) {
|
||||
await _flutterBuildAot(path);
|
||||
await _flutterBuildApk(path);
|
||||
await _flutterBuildIpa(path);
|
||||
final Stream<FileSystemEntity> exampleDirectories = Directory(path.join(flutterRoot, 'examples')).list();
|
||||
await for (FileSystemEntity fileEntity in exampleDirectories) {
|
||||
if (fileEntity is! Directory) {
|
||||
continue;
|
||||
}
|
||||
final String examplePath = fileEntity.path;
|
||||
final String basename = path.basename(examplePath);
|
||||
final bool expectIpaBuildFailure = basename == 'platform_channel_swift'; // Remove when https://github.com/flutter/flutter/issues/35773 is fixed.
|
||||
|
||||
await _flutterBuildAot(examplePath);
|
||||
await _flutterBuildApk(examplePath);
|
||||
await _flutterBuildIpa(examplePath, expectIpaBuildFailure: expectIpaBuildFailure);
|
||||
}
|
||||
await _flutterBuildDart2js(path.join('dev', 'integration_tests', 'web'));
|
||||
|
||||
@@ -318,7 +321,7 @@ Future<void> _flutterBuildApk(String relativePathToApplication) async {
|
||||
print('Done.');
|
||||
}
|
||||
|
||||
Future<void> _flutterBuildIpa(String relativePathToApplication) async {
|
||||
Future<void> _flutterBuildIpa(String relativePathToApplication, {bool expectIpaBuildFailure = false}) async {
|
||||
if (!Platform.isMacOS) {
|
||||
return;
|
||||
}
|
||||
@@ -337,7 +340,7 @@ Future<void> _flutterBuildIpa(String relativePathToApplication) async {
|
||||
await runCommand(flutter,
|
||||
<String>['build', 'ios', '--no-codesign', '--debug', '-v'],
|
||||
workingDirectory: path.join(flutterRoot, relativePathToApplication),
|
||||
expectNonZeroExit: false,
|
||||
expectNonZeroExit: expectIpaBuildFailure,
|
||||
timeout: _kShortTimeout,
|
||||
);
|
||||
print('Done.');
|
||||
|
||||
Reference in New Issue
Block a user