Skip to content

Commit a2005a2

Browse files
authored
Merge pull request brianegan#125 from fkorotkov/patch-2
Configure Cirrus CI
2 parents 54704bd + 5837002 commit a2005a2

File tree

3 files changed

+89
-2
lines changed

3 files changed

+89
-2
lines changed

.cirrus.yml

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
timeout_in: 30m
2+
3+
task:
4+
# this task should fail fast or rely on 'depends_on' for all other tasks
5+
name: Tests (Unit)
6+
container:
7+
image: cirrusci/flutter:latest
8+
pub_cache:
9+
folder: ~/.pub-cache
10+
activate_coverage_script: pub global activate coverage
11+
tests_script: ./scripts/runTests.sh
12+
13+
task:
14+
name: Integration Tests for $app_arch (Linux)
15+
# don't run for PRs
16+
only_if: $CIRRUS_PR == ''
17+
skip: '!changesInclude(".cirrus.yml", "$app_arch/*", "$app_arch/**/*")'
18+
env:
19+
EMULATOR_API_LEVEL: 22
20+
ANDROID_ABI: "default;armeabi-v7a"
21+
matrix:
22+
app_arch: bloc_flutter
23+
app_arch: bloc_library
24+
app_arch: built_redux
25+
app_arch: firestore_redux
26+
app_arch: frideos_library
27+
app_arch: inherited_widget
28+
app_arch: mvc
29+
app_arch: mvi_flutter
30+
app_arch: mvu
31+
app_arch: redurx
32+
app_arch: redux
33+
app_arch: scoped_model
34+
app_arch: simple_bloc_flutter
35+
app_arch: vanilla
36+
container:
37+
image: cirrusci/flutter:latest
38+
allow_failures: $app_arch == "mvu" || $app_arch == "redurx"
39+
install_images_script: sdkmanager "system-images;android-$EMULATOR_API_LEVEL;$ANDROID_ABI"
40+
create_device_script:
41+
echo no | avdmanager create avd --force -n test -k "system-images;android-$EMULATOR_API_LEVEL;$ANDROID_ABI"
42+
start_emulator_background_script:
43+
$ANDROID_HOME/emulator/emulator -avd test -no-audio -no-window
44+
pub_cache:
45+
folder: ~/.pub-cache
46+
wait_for_emulator_script:
47+
- ./scripts/android-wait-for-emulator.sh
48+
- adb shell input keyevent 82
49+
doctor_script: flutter doctor -v
50+
devices_script: flutter devices
51+
ci_script: ./scripts/ci.sh ./$app_arch || ./scripts/ci.sh ./$app_arch
52+
53+
task:
54+
name: Integration Tests for $app_arch (macOS)
55+
# don't run for PRs
56+
only_if: $CIRRUS_PR == ''
57+
skip: '!changesInclude(".cirrus.yml", "$app_arch/*", "$app_arch/**/*")'
58+
env:
59+
matrix:
60+
app_arch: bloc_flutter
61+
app_arch: bloc_library
62+
app_arch: built_redux
63+
app_arch: firestore_redux
64+
app_arch: frideos_library
65+
app_arch: inherited_widget
66+
app_arch: mvc
67+
app_arch: mvi_flutter
68+
app_arch: mvu
69+
app_arch: redurx
70+
app_arch: redux
71+
app_arch: scoped_model
72+
app_arch: simple_bloc_flutter
73+
app_arch: vanilla
74+
allow_failures: $app_arch == "mvu"
75+
osx_instance:
76+
image: mojave-flutter
77+
simulator_script:
78+
- xcrun simctl list devicetypes
79+
- xcrun simctl list runtimes
80+
# create simulator
81+
- udid=$(xcrun simctl create "iPhone X" com.apple.CoreSimulator.SimDeviceType.iPhone-X com.apple.CoreSimulator.SimRuntime.iOS-12-1)
82+
# boot simulator
83+
- xcrun simctl boot $udid
84+
doctor_script: flutter doctor -v
85+
devices_script: flutter devices
86+
ci_script: ./scripts/ci.sh ./$app_arch || ./scripts/ci.sh ./$app_arch

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# flutter_architecture_samples
22

33
[![Build Status](https://travis-ci.org/brianegan/flutter_architecture_samples.svg?branch=master)](https://travis-ci.org/brianegan/flutter_architecture_samples)
4+
[![Build Status](https://api.cirrus-ci.com/github/brianegan/flutter_architecture_samples.svg)](https://cirrus-ci.com/github/brianegan/flutter_architecture_samples)
45
[![codecov](https://codecov.io/gh/brianegan/flutter_architecture_samples/branch/master/graph/badge.svg)](https://codecov.io/gh/brianegan/flutter_architecture_samples)
56

67
<img align="right" src="assets/todo-list.png" alt="List of Todos Screen">

scripts/runTests.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ runTests () {
5757
# pure dart
5858
echo "run dart tests"
5959
pub get
60-
pub global run coverage:collect_coverage --port=8111 -o coverage.json --resume-isolates --wait-paused &
60+
nohup pub global run coverage:collect_coverage --port=8111 -o coverage.json --resume-isolates --wait-paused &
6161
dart --pause-isolates-on-exit --enable-vm-service=8111 "test/all_tests.dart" || error=true
6262
pub global run coverage:format_coverage --packages=.packages -i coverage.json --report-on lib --lcov --out lcov.info
6363
if [ -f "lcov.info" ]; then
@@ -115,4 +115,4 @@ esac
115115
if [ "$error" = true ] ;
116116
then
117117
exit -1
118-
fi
118+
fi

0 commit comments

Comments
 (0)