Skip to content

Commit

Permalink
Configure Cirrus CI (flutter#16224)
Browse files Browse the repository at this point in the history
* Configure Cirrus CI

* Read file directly instead of shelling a command

* Wait for all streams to finish

* Add LTR `textDirection`

Since `RenderFlex#_debugHasNecessaryDirections` requires it when `direction` is horizontal and there are multiple children.
  • Loading branch information
fkorotkov authored and Hixie committed May 1, 2018
1 parent c77ceb0 commit 7333459
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 13 deletions.
42 changes: 42 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
container:
image: cirrusci/flutter:base

task:
env:
CIRRUS_WORKING_DIR: "/tmp/flutter sdk"
PATH: "$CIRRUS_WORKING_DIR/bin:$CIRRUS_WORKING_DIR/bin/cache/dart-sdk/bin:$PATH"
SHARD: "$CIRRUS_TASK_NAME"

git_fetch_script: git fetch origin
setup_script: |
echo "SDK directory is: $PWD"
./bin/flutter --version
# disable analytics on the bots and download Flutter dependencies
./bin/flutter config --no-analytics
# run pub get in all the repo packages
./bin/flutter update-packages
matrix:
- name: docs
docs_script: ./dev/bots/docs.sh
- name: analyze
test_script: dart ./dev/bots/test.dart
- name: tests
test_script: dart ./dev/bots/test.dart
container:
cpu: 4
memory: 8G

windows_task:
windows_container:
dockerfile: dev/bots/docker/Dockerfile.windows
env:
CIRRUS_WORKING_DIR: "C:\\Windows\\Temp\\flutter sdk"
git_fetch_script: git fetch origin
setup_script:
- bin\flutter.bat config --no-analytics
- bin\flutter.bat update-packages
test_all_script:
- bin\cache\dart-sdk\bin\dart.exe -c dev\bots\test.dart
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# <img src="https://flutter.io/images/flutter-mark-square-100.png" alt="Flutter" width="40" height="40" /> Flutter [![Join Gitter Chat Channel -](https://badges.gitter.im/flutter/flutter.svg)](https://gitter.im/flutter/flutter?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status - Travis](https://travis-ci.org/flutter/flutter.svg?branch=master)](https://travis-ci.org/flutter/flutter) [![Build Status - AppVeyor](https://ci.appveyor.com/api/projects/status/meyi9evcny64a2mg/branch/master?svg=true)](https://ci.appveyor.com/project/flutter/flutter/branch/master) [![Coverage Status -](https://coveralls.io/repos/github/flutter/flutter/badge.svg?branch=master)](https://coveralls.io/github/flutter/flutter?branch=master)
# <img src="https://flutter.io/images/flutter-mark-square-100.png" alt="Flutter" width="40" height="40" /> Flutter [![Join Gitter Chat Channel -](https://badges.gitter.im/flutter/flutter.svg)](https://gitter.im/flutter/flutter?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status - Travis](https://travis-ci.org/flutter/flutter.svg?branch=master)](https://travis-ci.org/flutter/flutter) [![Build Status - AppVeyor](https://ci.appveyor.com/api/projects/status/meyi9evcny64a2mg/branch/master?svg=true)](https://ci.appveyor.com/project/flutter/flutter/branch/master) [![Build Status - Cirrus](https://api.cirrus-ci.com/github/flutter/flutter.svg)](https://cirrus-ci.com/github/flutter/flutter) [![Coverage Status -](https://coveralls.io/repos/github/flutter/flutter/badge.svg?branch=master)](https://coveralls.io/github/flutter/flutter?branch=master)

A new mobile app SDK to help developers and designers build modern mobile apps for iOS and Android. Flutter is an open-source project currently in beta.

Expand Down
13 changes: 13 additions & 0 deletions dev/bots/docker/Dockerfile.windows
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM microsoft/windowsservercore:1709

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

RUN netsh interface ipv4 set subinterface 'vEthernet (Ethernet)' mtu=1460 store=persistent

RUN Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

RUN choco install -y git

SHELL ["cmd", "/S", "/C"]

RUN setx /m PATH "%PATH%;C:\nodejs"
18 changes: 7 additions & 11 deletions dev/bots/test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,12 @@ Future<Null> _verifyInternationalizations() async {
);

final String localizationsFile = path.join('packages', 'flutter_localizations', 'lib', 'src', 'l10n', 'localizations.dart');
final String expectedResult = await new File(localizationsFile).readAsString();

final String executable = Platform.isWindows ? 'powershell' : 'cat';
final List<String> args = Platform.isWindows ?
<String>['\$PSDefaultParameterValues["*:Encoding"]="utf8";(gc $localizationsFile) -join "`n"']:
<String>[localizationsFile];

final EvalResult sourceContents = await _evalCommand(executable, args, workingDirectory: flutterRoot);

if (genResult.stdout.trim() != sourceContents.stdout.trim()) {
if (genResult.stdout.trim() != expectedResult.trim()) {
stderr
..writeln('<<<<<<< $localizationsFile')
..writeln(sourceContents.stdout.trim())
..writeln(expectedResult.trim())
..writeln('=======')
..writeln(genResult.stdout.trim())
..writeln('>>>>>>> gen_localizations')
Expand Down Expand Up @@ -343,8 +337,10 @@ Future<Null> _runCommand(String executable, List<String> arguments, {

Future<List<List<int>>> savedStdout, savedStderr;
if (printOutput) {
stdout.addStream(process.stdout);
stderr.addStream(process.stderr);
await Future.wait(<Future<Null>>[
stdout.addStream(process.stdout),
stderr.addStream(process.stderr)
]);
} else {
savedStdout = process.stdout.toList();
savedStderr = process.stderr.toList();
Expand Down
2 changes: 1 addition & 1 deletion examples/layers/rendering/flex_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'package:flutter/rendering.dart';
import 'src/solid_color_box.dart';

void main() {
final RenderFlex table = new RenderFlex(direction: Axis.vertical);
final RenderFlex table = new RenderFlex(direction: Axis.vertical, textDirection: TextDirection.ltr);

void addAlignmentRow(CrossAxisAlignment crossAxisAlignment) {
TextStyle style = const TextStyle(color: const Color(0xFF000000));
Expand Down

0 comments on commit 7333459

Please sign in to comment.