forked from leancodepl/patrol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.cirrus.yml
101 lines (98 loc) · 3.61 KB
/
.cirrus.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
test_linux_task:
name: Test `patrol develop` on Linux
required_pr_labels:
- 'package: patrol_cli'
- 'package: patrol'
container:
image: ghcr.io/cirruslabs/flutter:stable
cpu: 6
memory: 10G
kvm: 'true'
env:
PATH: $HOME/.pub-cache/bin:$HOME/fvm/default/bin:$CIRRUS_WORKING_DIR/fvm:${PATH}
FLUTTER_VERSION: '3.10'
EMULATOR_API_LEVEL: '34'
EMULATOR_ABI: google_apis_playstore;x86_64
EMULATOR_IMAGE: system-images;android-${EMULATOR_API_LEVEL};${EMULATOR_ABI}
timeout_in: 30m
set_up_fvm_script: |
curl -LO https://github.com/fluttertools/fvm/releases/download/2.4.1/fvm-2.4.1-linux-x64.tar.gz
tar -xf fvm-2.4.1-linux-x64.tar.gz
find_latest_matching_flutter_version_script: |
flutter_versions=$(fvm releases)
flutter_matching_versions=$(echo "$flutter_versions" | grep -v "pre" | grep -o " ${FLUTTER_VERSION}.[0-9]*")
latest_flutter_matching_version=$(echo "$flutter_matching_versions" | sort -rV | head -n 1)
echo "LATEST_MATCHING_FLUTTER_VERSION=$latest_flutter_matching_version" >> $CIRRUS_ENV
setup_flutter_script: |
echo "y" | fvm global $LATEST_MATCHING_FLUTTER_VERSION
fvm doctor
flutter --version
flutter precache
generate_gradlew_script: |
cd packages/patrol/example
flutter build apk --target lib/main.dart --debug --flavor=does-not-exist &
start=$SECONDS
until [ -e "android/gradlew" ] || [ $(($SECONDS - start)) -ge 120 ]; do sleep 2; done
if [ ! -e "android/gradlew" ]; then
echo "android/gradlew was not generated within the 2 minutes timeout"
exit 1
fi
kill $!
setup_patrol_cli_script:
- dart pub global activate --source path packages/patrol_cli && patrol
setup_emulator_script: |
sdkmanager --install "$EMULATOR_IMAGE"
sdkmanager --install emulator
create_emulator_script: |
avdmanager -s create avd -n MyAVD -k "$EMULATOR_IMAGE"
cat << EOF >> ~/.android/avd/MyAVD.avd/config.ini
hw.cpu.ncore=2
hw.gpu.enabled=yes
hw.gpu.mode=swiftshader_indirect
hw.ramSize=3072
disk.dataPartition.size=6G
vm.heapSize=576
hw.lcd.density=440
hw.lcd.height=2220
hw.lcd.width=1080
EOF
start_emulator_background_script:
- $ANDROID_HOME/emulator/emulator @MyAVD -verbose -no-snapshot-save -no-window -noaudio -no-boot-anim -accel on
wait_for_emulator_script:
- android-wait-for-emulator
patrol_develop_script: |
cd dev/cli_tests
dart pub get
dart patrol_develop_test.dart
test_macos_task:
name: Test `patrol develop` on macOS
required_pr_labels:
- 'package: patrol_cli'
- 'package: patrol'
macos_instance:
image: ghcr.io/cirruslabs/macos-ventura-xcode:latest
env:
PATH: $HOME/.pub-cache/bin:$HOME/fvm/default/bin:${PATH}
FLUTTER_VERSION: '3.10'
timeout_in: 30m
set_up_fvm_script: |
brew tap leoafarias/fvm
brew install fvm
find_latest_matching_flutter_version_script: |
flutter_versions=$(fvm releases)
flutter_matching_versions=$(echo "$flutter_versions" | grep -v "pre" | grep -o " ${FLUTTER_VERSION}.[0-9]*")
latest_flutter_matching_version=$(echo "$flutter_matching_versions" | sort -rV | head -n 1)
echo "LATEST_MATCHING_FLUTTER_VERSION=$latest_flutter_matching_version" >> $CIRRUS_ENV
setup_flutter_script: |
echo "y" | fvm global $LATEST_MATCHING_FLUTTER_VERSION
fvm doctor
flutter --version
flutter precache
setup_patrol_cli_script:
- dart pub global activate --source path packages/patrol_cli && patrol
setup_simulator_script: |
xcrun simctl boot "iPhone 14 Pro Max"
patrol_test_script: |
cd dev/cli_tests
dart pub get
dart patrol_develop_test.dart