Update CI config for Flutter 2 (#3674)

Includes cleanup to simplify our setup. Major changes:
- Eliminate the NNBD plugin filtering for stable.
- Remove the temporarily-added beta branch testing.
- Enable Linux, macOS, and web on stable (Windows is LUCI-based)
- Combine the two different macOS matrix configurations now that they
  are the same.
- Combine the two different Linux matrix configurations by using a single
  Dockerfile (which now also includes clang-format)
  - The web integration smoke test temporarily still uses the old Dockerfile,
    now renamed, because the driver installer script doesn't support
    Chrome 89 yet.
- Move most of the Linux tasks to lower-CPU machines to allow more
  tasks to run in parallel without hitting the community limit.
- Reorder the tasks slightly and give them comments to identify
  platform groupings
- Enabled web "build all plugins together" and "build all examples"
  tests
This commit is contained in:
stuartmorgan
2021-03-04 13:59:21 -08:00
committed by GitHub
parent c042ad3628
commit 373cf772f0
3 changed files with 105 additions and 26 deletions

View File

@ -19,6 +19,7 @@ class BuildExamplesCommand extends PluginCommand {
}) : super(packagesDir, fileSystem, processRunner: processRunner) {
argParser.addFlag(kLinux, defaultsTo: false);
argParser.addFlag(kMacos, defaultsTo: false);
argParser.addFlag(kWeb, defaultsTo: false);
argParser.addFlag(kWindows, defaultsTo: false);
argParser.addFlag(kIpa, defaultsTo: io.Platform.isMacOS);
argParser.addFlag(kApk);
@ -43,10 +44,10 @@ class BuildExamplesCommand extends PluginCommand {
!argResults[kApk] &&
!argResults[kLinux] &&
!argResults[kMacos] &&
!argResults[kWeb] &&
!argResults[kWindows]) {
print(
'None of --linux, --macos, --windows, --apk nor --ipa were specified, '
'so not building anything.');
print('None of --linux, --macos, --web, --windows, --apk, or --ipa were '
'specified, so not building anything.');
return;
}
final String flutterCommand =
@ -84,33 +85,43 @@ class BuildExamplesCommand extends PluginCommand {
if (argResults[kMacos]) {
print('\nBUILDING macOS for $packageName');
if (isMacOsPlugin(plugin, fileSystem)) {
// TODO(https://github.com/flutter/flutter/issues/46236):
// Builing macos without running flutter pub get first results
// in an error.
int exitCode = await processRunner.runAndStream(
flutterCommand, <String>['pub', 'get'],
flutterCommand,
<String>[
'build',
kMacos,
if (enableExperiment.isNotEmpty)
'--enable-experiment=$enableExperiment',
],
workingDir: example);
if (exitCode != 0) {
failingPackages.add('$packageName (macos)');
} else {
exitCode = await processRunner.runAndStream(
flutterCommand,
<String>[
'build',
kMacos,
if (enableExperiment.isNotEmpty)
'--enable-experiment=$enableExperiment',
],
workingDir: example);
if (exitCode != 0) {
failingPackages.add('$packageName (macos)');
}
}
} else {
print('macOS is not supported by this plugin');
}
}
if (argResults[kWeb]) {
print('\nBUILDING web for $packageName');
if (isWebPlugin(plugin, fileSystem)) {
int buildExitCode = await processRunner.runAndStream(
flutterCommand,
<String>[
'build',
kWeb,
if (enableExperiment.isNotEmpty)
'--enable-experiment=$enableExperiment',
],
workingDir: example);
if (buildExitCode != 0) {
failingPackages.add('$packageName (web)');
}
} else {
print('Web is not supported by this plugin');
}
}
if (argResults[kWindows]) {
print('\nBUILDING Windows for $packageName');
if (isWindowsPlugin(plugin, fileSystem)) {

View File

@ -22,10 +22,10 @@ class FormatCommand extends PluginCommand {
FileSystem fileSystem, {
ProcessRunner processRunner = const ProcessRunner(),
}) : super(packagesDir, fileSystem, processRunner: processRunner) {
argParser.addFlag('travis', hide: true);
argParser.addFlag('fail-on-change', hide: true);
argParser.addOption('clang-format',
defaultsTo: 'clang-format',
help: 'Path to executable of clang-format v5.');
help: 'Path to executable of clang-format.');
}
@override
@ -46,7 +46,7 @@ class FormatCommand extends PluginCommand {
await _formatJava(googleFormatterPath);
await _formatCppAndObjectiveC();
if (argResults['travis']) {
if (argResults['fail-on-change']) {
final bool modified = await _didModifyAnything();
if (modified) {
throw ToolExit(1);