-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
135 lines (116 loc) · 3.23 KB
/
Taskfile.yml
File metadata and controls
135 lines (116 loc) · 3.23 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
version: '3'
dotenv: ['.env']
vars:
ANDROID_APP: androidApp/build/outputs/apk/debug/androidApp-debug.apk
IOS_APP: iosApp/build/Build/Products/Debug-iphonesimulator/iosApp.app
ANDROID_PACKAGE: org.idos.app
IOS_BUNDLE: org.idos.app
tasks:
# Lint & Test
lint:
desc: Run linting (ktlint + detekt)
cmds:
- ./gradlew ktlintCheck detekt
test:unit:
desc: Run all unit tests
cmds:
- ./gradlew allTests
# Build SDK
build:shared:android:
desc: Build Android SDK (AAR)
cmds:
- ./gradlew :shared:assembleRelease
build:shared:ios:
desc: Build iOS SDK (XCFramework)
cmds:
- ./gradlew :shared:assembleIdos_sdkReleaseXCFramework
# Build sample apps
android:build:
desc: Build Android debug APK
cmds:
- ./gradlew :androidApp:assembleDebug
android:install:
desc: Install Android app on emulator/device
cmds:
- adb install -r {{.ANDROID_APP}}
ios:build:
desc: Build iOS app for simulator
dir: iosApp
cmds:
- xcodebuild build -scheme iosApp -destination 'platform=iOS Simulator,name=iPhone 16' -derivedDataPath build
# Maestro tasks
maestro:install:
desc: Install Maestro CLI
cmds:
- brew install maestro
status:
- which maestro
android:emulator:
desc: Start Android emulator if not running
cmds:
- |
if ! adb devices | grep -q "emulator"; then
AVD=$($ANDROID_HOME/emulator/emulator -list-avds | head -1)
$ANDROID_HOME/emulator/emulator -avd $AVD -no-snapshot-load -no-audio -no-boot-anim &
adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done'
fi
status:
- adb devices | grep -q "emulator"
maestro:android:
desc: Run all Maestro tests on Android
deps: [android:build, android:emulator, android:install]
cmds:
- |
maestro test \
--format junit \
--output maestro-results-android.xml \
--env APP_ID="{{.ANDROID_PACKAGE}}" \
--env PASSWORD="{{.PASSWORD}}" \
maestro-flows/
maestro:ios:
desc: Run all Maestro tests on iOS
deps: [ios:build]
cmds:
- |
xcrun simctl boot "iPhone 17" || true
xcrun simctl install booted {{.IOS_APP}}
maestro test \
--format junit \
--output maestro-results-ios.xml \
--env APP_ID="{{.IOS_BUNDLE}}" \
--env PASSWORD="{{.PASSWORD}}" \
maestro-flows/
maestro:all:
desc: Run Maestro tests on both platforms
cmds:
- task: maestro:android
- task: maestro:ios
# Combined shortcuts
test:all:
desc: Run all tests
cmds:
- task: maestro:all
build:all:
desc: Build both Android and iOS apps
cmds:
- task: android:build
- task: ios:build
# CI stages
ci:pr:
desc: PR validation (lint + test + build apps)
cmds:
- task: lint
- task: test:unit
- task: android:build
- task: ios:build
ci:master:
desc: Master validation (PR + Maestro tests)
cmds:
- task: ci:pr
- task: maestro:all
ci:release:
desc: Release build (master + SDK build)
cmds:
- task: ci:master
- task: build:shared:android
- task: build:shared:ios