Unverified Commit 72926bdf authored by Dan Field's avatar Dan Field Committed by GitHub

Smoke test building IPA and APK on supported platforms (#24601)

* build tests - AOT on all, APK on Linux, IPA on Mac
parent c80244d1
...@@ -38,6 +38,7 @@ task: ...@@ -38,6 +38,7 @@ task:
- analyze - analyze
- tests-linux - tests-linux
- tool_tests-linux - tool_tests-linux
- build_tests-linux
env: env:
SHARD: deploy_gallery SHARD: deploy_gallery
GOOGLE_DEVELOPER_SERVICE_ACCOUNT_ACTOR_FASTLANE: ENCRYPTED[d9ac1462c3c556fc2f8165c9d5566a16497d8ebc38a50357f7f3abf136b7f83e1d1d76dde36fee356cb0f9ebf7a89346] GOOGLE_DEVELOPER_SERVICE_ACCOUNT_ACTOR_FASTLANE: ENCRYPTED[d9ac1462c3c556fc2f8165c9d5566a16497d8ebc38a50357f7f3abf136b7f83e1d1d76dde36fee356cb0f9ebf7a89346]
...@@ -62,9 +63,9 @@ task: ...@@ -62,9 +63,9 @@ task:
container: container:
cpu: 4 cpu: 4
memory: 12G memory: 12G
- name: aot_build_tests-linux - name: build_tests-linux
env: env:
SHARD: aot_build_tests SHARD: build_tests
test_script: test_script:
- dart ./dev/bots/test.dart - dart ./dev/bots/test.dart
container: container:
...@@ -110,6 +111,12 @@ task: ...@@ -110,6 +111,12 @@ task:
- name: tool_tests-windows - name: tool_tests-windows
env: env:
SHARD: tool_tests SHARD: tool_tests
- name: build_tests-windows
env:
SHARD: build_tests
container:
cpu: 4
memory: 12G
task: task:
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' && $CIRRUS_PR == '' use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' && $CIRRUS_PR == ''
...@@ -121,6 +128,7 @@ task: ...@@ -121,6 +128,7 @@ task:
- analyze - analyze
- tests-macos - tests-macos
- tool_tests-macos - tool_tests-macos
- build_tests-macos
env: env:
# Name the SDK directory to include a space so that we constantly # Name the SDK directory to include a space so that we constantly
# test path names with spaces in them. # test path names with spaces in them.
...@@ -153,6 +161,8 @@ task: ...@@ -153,6 +161,8 @@ task:
- analyze - analyze
env: env:
CIRRUS_WORKING_DIR: "/tmp/flutter sdk" CIRRUS_WORKING_DIR: "/tmp/flutter sdk"
install_cocoapods_script:
- sudo gem install cocoapods
git_fetch_script: git_fetch_script:
- git fetch origin - git fetch origin
- git fetch origin master # To set FETCH_HEAD for "git merge-base" to work - git fetch origin master # To set FETCH_HEAD for "git merge-base" to work
...@@ -178,6 +188,14 @@ task: ...@@ -178,6 +188,14 @@ task:
- name: tool_tests-macos - name: tool_tests-macos
env: env:
SHARD: tool_tests SHARD: tool_tests
- name: build_tests-macos
env:
SHARD: build_tests
COCOAPODS_DISABLE_STATS: true
FLUTTER_FRAMEWORK_DIR: "/tmp/flutter sdk/bin/cache/artifacts/engine/ios/"
container:
cpu: 4
memory: 12G
docker_builder: docker_builder:
...@@ -190,6 +208,7 @@ docker_builder: ...@@ -190,6 +208,7 @@ docker_builder:
- analyze - analyze
- tests-linux - tests-linux
- tool_tests-linux - tool_tests-linux
- build_tests-linux
build_script: "$CIRRUS_WORKING_DIR/dev/ci/docker_linux/docker_build.sh" build_script: "$CIRRUS_WORKING_DIR/dev/ci/docker_linux/docker_build.sh"
login_script: "$CIRRUS_WORKING_DIR/dev/ci/docker_linux/docker_login.sh" login_script: "$CIRRUS_WORKING_DIR/dev/ci/docker_linux/docker_login.sh"
push_script: "$CIRRUS_WORKING_DIR/dev/ci/docker_linux/docker_push.sh" push_script: "$CIRRUS_WORKING_DIR/dev/ci/docker_linux/docker_push.sh"
......
...@@ -21,7 +21,7 @@ final List<String> flutterTestArgs = <String>[]; ...@@ -21,7 +21,7 @@ final List<String> flutterTestArgs = <String>[];
const Map<String, ShardRunner> _kShards = <String, ShardRunner>{ const Map<String, ShardRunner> _kShards = <String, ShardRunner>{
'tests': _runTests, 'tests': _runTests,
'tool_tests': _runToolTests, 'tool_tests': _runToolTests,
'aot_build_tests': _runAotBuildTests, 'build_tests': _runBuildTests,
'coverage': _runCoverage, 'coverage': _runCoverage,
}; };
...@@ -150,25 +150,76 @@ Future<void> _runToolTests() async { ...@@ -150,25 +150,76 @@ Future<void> _runToolTests() async {
print('${bold}DONE: All tests successful.$reset'); print('${bold}DONE: All tests successful.$reset');
} }
/// Verifies that AOT builds of some examples apps finish /// Verifies that AOT, APK, and IPA (if on macOS) builds of some
/// without crashing. It does not actually launch the AOT-built /// examples apps finish without crashing. It does not actually
/// apps. That happens later in the devicelab. This is just /// launch the apps. That happens later in the devicelab. This is
/// a smoke-test. /// just a smoke-test. In particular, this will verify we can build
Future<void> _runAotBuildTests() async { /// when there are spaces in the path name for the Flutter SDK and
await _flutterBuildAot(path.join('examples', 'hello_world')); /// target app.
await _flutterBuildAot(path.join('examples', 'flutter_gallery')); Future<void> _runBuildTests() async {
await _flutterBuildAot(path.join('examples', 'flutter_view')); 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);
}
print('${bold}DONE: All build tests successful.$reset');
}
Future<void> _flutterBuildAot(String relativePathToApplication) async {
print('Running AOT build tests...');
await runCommand(flutter,
<String>['build', 'aot', '-v'],
workingDirectory: path.join(flutterRoot, relativePathToApplication),
expectNonZeroExit: false,
timeout: _kShortTimeout,
);
print('Done.');
}
print('${bold}DONE: All AOT build tests successful.$reset'); Future<void> _flutterBuildApk(String relativePathToApplication) async {
// TODO(dnfield): See if we can get Android SDK on all Cirrus platforms.
if (Platform.environment['ANDROID_HOME']?.isEmpty ?? true) {
return;
}
print('Running APK build tests...');
await runCommand(flutter,
<String>['build', 'apk', '--debug', '-v'],
workingDirectory: path.join(flutterRoot, relativePathToApplication),
expectNonZeroExit: false,
timeout: _kShortTimeout,
);
print('Done.');
} }
Future<void> _flutterBuildAot(String relativePathToApplication) { Future<void> _flutterBuildIpa(String relativePathToApplication) async {
return runCommand(flutter, if (!Platform.isMacOS) {
<String>['build', 'aot'], return;
}
print('Running IPA build tests...');
// Install Cocoapods. We don't have these checked in for the examples,
// and build ios doesn't take care of it automatically.
final File podfile = File(path.join(flutterRoot, relativePathToApplication, 'ios', 'Podfile'));
if (podfile.existsSync()) {
await runCommand('pod',
<String>['install'],
workingDirectory: podfile.parent.path,
expectNonZeroExit: false,
timeout: _kShortTimeout,
);
}
await runCommand(flutter,
<String>['build', 'ios', '--no-codesign', '--debug', '-v'],
workingDirectory: path.join(flutterRoot, relativePathToApplication), workingDirectory: path.join(flutterRoot, relativePathToApplication),
expectNonZeroExit: false, expectNonZeroExit: false,
timeout: _kShortTimeout, timeout: _kShortTimeout,
); );
print('Done.');
} }
Future<void> _runTests() async { Future<void> _runTests() async {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment